Repository: catalystneuro/neuroconv

Issue:
[Bug]: Object of type `LabMetaDataExtension` is not JSON serializable
### What happened?

I am save a custom `.mat` matlab data file using nwb extension called tank-lab-to-nwb  ([repo](https://github.com/catalystneuro/tank-lab-to-nwb)) that uses the ndx-tank-metadata ([repo](https://github.com/catalystneuro/ndx-tank-metadata), [pip](https://pypi.org/project/ndx-tank-metadata/)) on github. 

I am able to properly load in example .mat data and add the information to an empty in-memory nwbfile by doing
```python
from pynwb.testing.mock.file import mock_NWBFile
empty_nwb = mock_NWBFile()
interface.add_to_nwbfile(empty_nwb, metadata = metadata)
````
where interface is the custom VirmenDataInterface from the tank_lab_to_nwb repo. 

The alternative of `interface.create_nwbfile(metadata = metadata)` also safely creates an in-memory NWB file. The error comes when I execute `interface.run_conversion(nwbfile_path="./fdf13.nwb", metadata = metadata, overwrite=True)` , I end up with the error below.


Some useful information about the variables in question. 

@CodyCBakerPhD  since you had worked on this previously, do you have an idea of which variable type this might be failing?



The `obj` value when the code fails 

```python
obj
LabMetaData abc.LabMetaDataExtension at 0x5790013840
Fields:
  commit_id: 3611d165cf09db453e272b63e3f460cb95d3c10f New stationary task, copy velocity-position
  experiment_name: jessejorge_pwm_v2
  location: 165I-miniVR-T-6
  mazes: mazes <class 'ndx_tank_metadata.maze_extension.MazeExtension'>
  num_trials: 200
  protocol_name: pwm_jessejorge_v2
  rig: rig abc.RigExtension at 0x5790020608
Fields:
  arduinoPort: COM6
  ballCircumference: 63.8
  colorAdjustment: [0.  0.4 0.5]
  hasDAQ: 1
  hasSyncComm: 0
  laserChannel: 3
  leftPuffChannel: 1
  minIterationDT: 0.01
  nidaqDevice: 1
  nidaqLines: [ 0 11]
  nidaqPort: 0
  rewardChannel: 0
  rewardDuration: 0.025
  rewardSize: 0.004
  rig: 165I-miniVR-T-6
  rightPuffChannel: 2
  sensorDotsPerRev: [2310.1 2310.1 2310.1 2310.1]
  simulationMode: 0
  soundAdjustment: 0.2
  syncClockChannel: 5
  syncDataChannel: 6
  toroidXFormP1: 0.3879
  toroidXFormP2: 0.392

  session_end_time: 2024-03-22T12:09:54.779000
  stimulus_bank_path: C:\Experiments\ViRMEn\experiments\protocols\stimulus_trains_pwm_jessejorge_v2.mat
  world_file_name: jessejorge_pwm_v2
```

```python
obj.mazes
mazes ndx_tank_metadata.maze_extension.MazeExtension at 0x5790015136
Fields:
  colnames: ['world' 'lStart' 'lCue' 'lMemory' 'cueDuration' 'cueVisibleAt'
 'cueProbability' 'cueDensityPerM' 'antiFraction' 'nCueSlots'
 'tri_turnHint' 'color' 'numTrials' 'numTrialsPerMin' 'criteriaNTrials'
 'warmupNTrials' 'numSessions' 'performance' 'maxBias' 'warmupMaze'
 'warmupPerform' 'warmupBias' 'warmupMotor' 'easyBlock' 'easyBlockNTrials'
 'numBlockTrials' 'blockPerform']
  columns: (
    world <class 'hdmf.common.table.VectorData'>,
    lStart <class 'hdmf.common.table.VectorData'>,
    lCue <class 'hdmf.common.table.VectorData'>,
    lMemory <class 'hdmf.common.table.VectorData'>,
    cueDuration <class 'hdmf.common.table.VectorData'>,
    cueVisibleAt <class 'hdmf.common.table.VectorData'>,
    cueProbability <class 'hdmf.common.table.VectorData'>,
    cueDensityPerM <class 'hdmf.common.table.VectorData'>,
    antiFraction <class 'hdmf.common.table.VectorData'>,
    nCueSlots <class 'hdmf.common.table.VectorData'>,
    tri_turnHint <class 'hdmf.common.table.VectorData'>,
    color <class 'hdmf.common.table.VectorData'>,
    numTrials <class 'hdmf.common.table.VectorData'>,
    numTrialsPerMin <class 'hdmf.common.table.VectorData'>,
    criteriaNTrials <class 'hdmf.common.table.VectorData'>,
    warmupNTrials <class 'hdmf.common.table.VectorData'>,
    numSessions <class 'hdmf.common.table.VectorData'>,
    performance <class 'hdmf.common.table.VectorData'>,
    maxBias <class 'hdmf.common.table.VectorData'>,
    warmupMaze <class 'hdmf.common.table.VectorData'>,
    warmupPerform <class 'hdmf.common.table.VectorData'>,
    warmupBias <class 'hdmf.common.table.VectorData'>,
    warmupMotor <class 'hdmf.common.table.VectorData'>,
    easyBlock <class 'hdmf.common.table.VectorData'>,
    easyBlockNTrials <class 'hdmf.common.table.VectorData'>,
    numBlockTrials <class 'hdmf.common.table.VectorData'>,
    blockPerform <class 'hdmf.common.table.VectorData'>
  )
  description: description of the mazes
  id: id <class 'hdmf.common.table.ElementIdentifiers'
```

```python
obj.rig
rig abc.RigExtension at 0x5790020608
Fields:
  arduinoPort: COM6
  ballCircumference: 63.8
  colorAdjustment: [0.  0.4 0.5]
  hasDAQ: 1
  hasSyncComm: 0
  laserChannel: 3
  leftPuffChannel: 1
  minIterationDT: 0.01
  nidaqDevice: 1
  nidaqLines: [ 0 11]
  nidaqPort: 0
  rewardChannel: 0
  rewardDuration: 0.025
  rewardSize: 0.004
  rig: 165I-miniVR-T-6
  rightPuffChannel: 2
  sensorDotsPerRev: [2310.1 2310.1 2310.1 2310.1]
  simulationMode: 0
  soundAdjustment: 0.2
  syncClockChannel: 5
  syncDataChannel: 6
  toroidXFormP1: 0.3879
  toroidXFormP2: 0.392
```

### Steps to Reproduce

```python
# %% The script used to get this bug
"""Author: Christian"""
# from tank_lab_to_nwb import VirmenDataInterface
import sys
import os
sys.path.append(os.getcwd())
print(os.getcwd())

from pathlib import Path
from isodate import duration_isoformat
from datetime import timedelta, datetime

import neuroconv

from tank_lab_to_nwb.convert_towers_task.virmenbehaviordatainterface import VirmenDataInterface



# %%
base_path = Path("/Users/ct5868/code/tank-lab-to-nwb/")
virmen_file_path = base_path / "behavior_local" / "jessejorge_pwm_jessejorge_pwm_pilot_165I-miniVR-T-6_jyanar_ya011_T_20240322.mat"


interface = VirmenDataInterface(file_path = virmen_file_path)

# %%
metadata = interface.get_metadata()
print(metadata)

# %%
metadata["Subject"] = dict(
    subject_id="M001",
    sex="M",
    age="P30D",
    species="Mus musculus",
)


# %%
interface.get_metadata_schema()

# %%
from datetime import datetime
from zoneinfo import ZoneInfo

metadata["NWBFile"]["session_start_time"] = datetime(2021, 1, 1, 12, 0, 0, tzinfo=ZoneInfo("US/Pacific"))

# %%
interface.get_metadata_schema()

# %%
from pynwb.testing.mock.file import mock_NWBFile
empty_nwb = mock_NWBFile()

print(metadata)


# %%


interface.create_nwbfile(metadata = metadata)
interface.run_conversion(nwbfile_path="./mariokart.nwb", metadata = metadata, overwrite=True)
# interface.run_conversion(nwbfile_path="./fdf13.nwb", metadata = metadata, overwrite=True)

# %%
```


### Traceback

```python
Exception has occurred: TypeError
Object of type LabMetaDataExtension is not JSON serializable
  File "/Users/ct5868/code/neuroconv/src/neuroconv/utils/json_schema.py", line 34, in default
    return super().default(obj)
  File "/Users/ct5868/code/neuroconv/src/neuroconv/utils/json_schema.py", line 350, in validate_metadata
    serialized_metadata = encoder.encode(metadata)
  File "/Users/ct5868/code/neuroconv/src/neuroconv/tools/nwb_helpers/_metadata_and_file_helpers.py", line 70, in make_nwbfile_from_metadata
    validate_metadata(metadata=metadata, schema=base_metadata_schema)
  File "/Users/ct5868/code/neuroconv/src/neuroconv/tools/nwb_helpers/_metadata_and_file_helpers.py", line 231, in make_or_load_nwbfile
    raise e
  File "/Users/ct5868/code/neuroconv/src/neuroconv/tools/nwb_helpers/_metadata_and_file_helpers.py", line 231, in make_or_load_nwbfile
    raise e
  File "/Users/ct5868/code/neuroconv/src/neuroconv/basedatainterface.py", line 167, in run_conversion
    with make_or_load_nwbfile(
  File "/Users/ct5868/code/tank-lab-to-nwb/notebooks/attempting behavior datainterfaces--debugging.py", line 62, in <module>
    interface.run_conversion(nwbfile_path="./mariokart.nwb", metadata = metadata, overwrite=True)
TypeError: Object of type LabMetaDataExtension is not JSON serializable
LabMetaData
```


### Operating System

Windows

### Python Executable

Conda

### Python Version

3.10

### Package Versions

[environment_for_issue.txt](https://github.com/user-attachments/files/15742688/environment_for_issue.txt)


### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/catalystneuro/neuroconv/blob/main/.github/CODE_OF_CONDUCT.rst)
- [X] Have you ensured this bug was not already [reported](https://github.com/catalystneuro/neuroconv/issues)?

Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) Report
Attention: Patch coverage is `90.00000%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 91.78%. Comparing base [(`a0a8036`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/a0a8036a9274054b8aae3feaaa0532564d5f27ce?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) to head [(`84187f8`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/84187f867fb450540bf24d72a891f31d9419fcdd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro).
> Report is 3 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/graphs/tree.svg?width=650&height=150&src=pr&token=h63OQoWehP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

```diff
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   91.82%   91.78%   -0.04%     
==========================================
  Files         125      125              
  Lines        7045     7072      +27     
==========================================
+ Hits         6469     6491      +22     
- Misses        576      581       +5     
```

| [Flag](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | `91.78% <90.00%> (-0.04%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Files](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [...roconv/tools/nwb\_helpers/\_dataset\_configuration.py](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&filepath=src%2Fneuroconv%2Ftools%2Fnwb_helpers%2F_dataset_configuration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#diff-c3JjL25ldXJvY29udi90b29scy9ud2JfaGVscGVycy9fZGF0YXNldF9jb25maWd1cmF0aW9uLnB5) | `94.80% <90.00%> (-0.72%)` | :arrow_down: |

</details>
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) Report
Attention: Patch coverage is `90.00000%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 91.78%. Comparing base [(`337ce2a`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/337ce2ae9979b8ec3dada0b7994afb105afb5919?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) to head [(`84187f8`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/84187f867fb450540bf24d72a891f31d9419fcdd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro).

> :exclamation: **Current head 84187f8 differs from pull request most recent head acffc19**
> 
> Please [upload](https://docs.codecov.com/docs/codecov-uploader) reports for the commit acffc19 to get more accurate results.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/graphs/tree.svg?width=650&height=150&src=pr&token=h63OQoWehP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

```diff
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   91.78%   91.78%   -0.01%     
==========================================
  Files         125      125              
  Lines        7062     7072      +10     
==========================================
+ Hits         6482     6491       +9     
- Misses        580      581       +1     
```

| [Flag](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | `91.78% <90.00%> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Files](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [...roconv/tools/nwb\_helpers/\_dataset\_configuration.py](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&filepath=src%2Fneuroconv%2Ftools%2Fnwb_helpers%2F_dataset_configuration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#diff-c3JjL25ldXJvY29udi90b29scy9ud2JfaGVscGVycy9fZGF0YXNldF9jb25maWd1cmF0aW9uLnB5) | `94.80% <90.00%> (-0.72%)` | :arrow_down: |

</details>
CodyCBakerPhD: > Would it make sense to fix it deeper yet? It seems that at least propagating this fix to the level of from_neurodata_object as we already have the full shape there and I see that both full shape and chunk shape are optional arguments.
> 
> Do you think that could work?

I debated how deeply to fix it but decided this shallow level is where it should be (alongside all the other skip conditions too)

The thing is, we really shouldn't be applying an iterator to something with a zero-length axis (or at least, if we wanted to, adding support for that at the top-level HDMF would be a much bigger development)

Likewise, we want `DatasetIOConfiguration.from_neurodata_object(...)` to error (rather than return `None`) in situations where it shouldn't apply, and setting control of zero-length parts of a chunk is broadly not something we've ever supported or tested (not that it couldn't be, but again would need some top-level effort and propagation)

So skipping it in the helper function for forming the entire backend configuration makes most sense to me
CodyCBakerPhD: We should probably wait for @tabedzki to confirm this works for them before merging

@tabedzki 

Please try

```bash
pip install git+https://github.com/catalystneuro/neuroconv.git@skip_dataset_configuration_zero_length_axis
```

and let me know if that works with the workflow I outlined in the issue
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) Report
Attention: Patch coverage is `90.00000%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 91.78%. Comparing base [(`337ce2a`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/337ce2ae9979b8ec3dada0b7994afb105afb5919?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) to head [(`acffc19`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/acffc19301afa846f2f5f7bcdeaf9a97ea118da3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro).

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/graphs/tree.svg?width=650&height=150&src=pr&token=h63OQoWehP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

```diff
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   91.78%   91.78%   -0.01%     
==========================================
  Files         125      125              
  Lines        7062     7072      +10     
==========================================
+ Hits         6482     6491       +9     
- Misses        580      581       +1     
```

| [Flag](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | `91.78% <90.00%> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Files](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [...roconv/tools/nwb\_helpers/\_dataset\_configuration.py](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&filepath=src%2Fneuroconv%2Ftools%2Fnwb_helpers%2F_dataset_configuration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#diff-c3JjL25ldXJvY29udi90b29scy9ud2JfaGVscGVycy9fZGF0YXNldF9jb25maWd1cmF0aW9uLnB5) | `94.80% <90.00%> (-0.72%)` | :arrow_down: |

</details>
h-mayorquin: OK, 
> Likewise, we want `DatasetIOConfiguration.from_neurodata_object(...)` to error (rather than return `None`) in situations where it shouldn't apply, and setting control of zero-length parts of a chunk is broadly not something we've ever supported or tested (not that it couldn't be, but again would need some top-level effort and propagation)

I was thinking that we should set chunk_size=None and buffer_size=None in those cases. My understanding is that is equivalent to skipping. Am I wrong? But, having an explicit error at that level makes sense to me as well. 

OK on waiting btw. This is ready to me, so let's just wait for @tabedzki to check if the fix works. 


CodyCBakerPhD: > I was thinking that we should set chunk_size=None and buffer_size=None in those cases.

The issue with that is (while that is accurate to how it ends up on disk) from an API perspective we make it _seem_ like those values could be changed when in reality they cannot; we've not built mutation validation conditions for attempts to set non-`None` chunks on objects that we otherwise don't support chunking in general on
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) Report
Attention: Patch coverage is `90.00000%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 91.78%. Comparing base [(`337ce2a`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/337ce2ae9979b8ec3dada0b7994afb105afb5919?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) to head [(`acffc19`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/acffc19301afa846f2f5f7bcdeaf9a97ea118da3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro).
> Report is 3 commits behind head on main.

> :exclamation: **Current head acffc19 differs from pull request most recent head d39cb22**
> 
> Please [upload](https://docs.codecov.com/docs/codecov-uploader) reports for the commit d39cb22 to get more accurate results.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/graphs/tree.svg?width=650&height=150&src=pr&token=h63OQoWehP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

```diff
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   91.78%   91.78%   -0.01%     
==========================================
  Files         125      125              
  Lines        7062     7072      +10     
==========================================
+ Hits         6482     6491       +9     
- Misses        580      581       +1     
```

| [Flag](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | `91.78% <90.00%> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Files](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [...roconv/tools/nwb\_helpers/\_dataset\_configuration.py](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&filepath=src%2Fneuroconv%2Ftools%2Fnwb_helpers%2F_dataset_configuration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#diff-c3JjL25ldXJvY29udi90b29scy9ud2JfaGVscGVycy9fZGF0YXNldF9jb25maWd1cmF0aW9uLnB5) | `94.80% <90.00%> (-0.72%)` | :arrow_down: |

</details>
h-mayorquin: > > I was thinking that we should set chunk_size=None and buffer_size=None in those cases.
> 
> The issue with that is (while that is accurate to how it ends up on disk) from an API perspective we make it _seem_ like those values could be changed when in reality they cannot; we've not built mutation validation conditions for attempts to set non-`None` chunks on objects that we otherwise don't support chunking in general on

OK, thanks for explaining. Can I summarize this point as things in configuration should have mutable properties for compression and iterative writing parameters but here we can't relally change them (they can only be None) so better not to include them in the dictionary?

This makes sense. 
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) Report
Attention: Patch coverage is `90.00000%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 90.95%. Comparing base [(`337ce2a`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/337ce2ae9979b8ec3dada0b7994afb105afb5919?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) to head [(`d39cb22`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/d39cb22c5c38a0fc3509ab601f53939e1dbf079e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro).
> Report is 3 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/graphs/tree.svg?width=650&height=150&src=pr&token=h63OQoWehP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

```diff
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   91.78%   90.95%   -0.84%     
==========================================
  Files         125      125              
  Lines        7062     7072      +10     
==========================================
- Hits         6482     6432      -50     
- Misses        580      640      +60     
```

| [Flag](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | `90.95% <90.00%> (-0.84%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Files](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [...roconv/tools/nwb\_helpers/\_dataset\_configuration.py](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&filepath=src%2Fneuroconv%2Ftools%2Fnwb_helpers%2F_dataset_configuration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#diff-c3JjL25ldXJvY29udi90b29scy9ud2JfaGVscGVycy9fZGF0YXNldF9jb25maWd1cmF0aW9uLnB5) | `94.80% <90.00%> (-0.72%)` | :arrow_down: |

... and [1 file with indirect coverage changes](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

</details>
tabedzki: Thank you! I'll be able to test this later and I'll let you know how it goes
tabedzki: I think it works as the error hasn't appeared again but I cannot 100% say as I still have some errors converting the Matlab file. I think one of the fields within the matlab struct is not being properly handled. Will report back later
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) Report
Attention: Patch coverage is `90.00000%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 90.95%. Comparing base [(`5a65e74`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/5a65e7417d90411bca3dce8312f8d6d483d30b05?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) to head [(`d39cb22`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/d39cb22c5c38a0fc3509ab601f53939e1dbf079e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro).

> :exclamation: **Current head d39cb22 differs from pull request most recent head 6199cb1**
> 
> Please [upload](https://docs.codecov.com/docs/codecov-uploader) reports for the commit 6199cb1 to get more accurate results.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/graphs/tree.svg?width=650&height=150&src=pr&token=h63OQoWehP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

```diff
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   90.95%   90.95%   -0.01%     
==========================================
  Files         125      125              
  Lines        7062     7072      +10     
==========================================
+ Hits         6423     6432       +9     
- Misses        639      640       +1     
```

| [Flag](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | `90.95% <90.00%> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Files](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [...roconv/tools/nwb\_helpers/\_dataset\_configuration.py](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&filepath=src%2Fneuroconv%2Ftools%2Fnwb_helpers%2F_dataset_configuration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#diff-c3JjL25ldXJvY29udi90b29scy9ud2JfaGVscGVycy9fZGF0YXNldF9jb25maWd1cmF0aW9uLnB5) | `94.80% <90.00%> (-0.72%)` | :arrow_down: |

</details>
tabedzki: @CodyCBakerPhD  I was able to confirm that using this branch in lieu of the main branch does indeed address this issue.

Thank you!
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) Report
Attention: Patch coverage is `90.00000%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 90.94%. Comparing base [(`5a65e74`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/5a65e7417d90411bca3dce8312f8d6d483d30b05?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) to head [(`37c6283`)](https://app.codecov.io/gh/catalystneuro/neuroconv/commit/37c62834a07c83d29e41e29418bcf32a39481f68?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro).
> Report is 1 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/graphs/tree.svg?width=650&height=150&src=pr&token=h63OQoWehP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro)

```diff
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   90.95%   90.94%   -0.01%     
==========================================
  Files         125      125              
  Lines        7062     7071       +9     
==========================================
+ Hits         6423     6431       +8     
- Misses        639      640       +1     
```

| [Flag](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | `90.94% <90.00%> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Files](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro) | Coverage Δ | |
|---|---|---|
| [...roconv/tools/nwb\_helpers/\_dataset\_configuration.py](https://app.codecov.io/gh/catalystneuro/neuroconv/pull/894?src=pr&el=tree&filepath=src%2Fneuroconv%2Ftools%2Fnwb_helpers%2F_dataset_configuration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=catalystneuro#diff-c3JjL25ldXJvY29udi90b29scy9ud2JfaGVscGVycy9fZGF0YXNldF9jb25maWd1cmF0aW9uLnB5) | `94.80% <90.00%> (-0.72%)` | :arrow_down: |

</details>

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 43916805..f1c3a3a1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Upcoming
 
+### Bug fixes
+* Added a skip condition in `get_default_dataset_io_configurations` for datasets with any zero-length axis in their `full_shape`. [PR #894](https://github.com/catalystneuro/neuroconv/pull/894)
+
+
+
 ## v0.4.10 (June 6, 2024)
 
 ### Bug fixes
diff --git a/src/neuroconv/tools/nwb_helpers/_dataset_configuration.py b/src/neuroconv/tools/nwb_helpers/_dataset_configuration.py
index 7637b3e6..f3d8e756 100644
--- a/src/neuroconv/tools/nwb_helpers/_dataset_configuration.py
+++ b/src/neuroconv/tools/nwb_helpers/_dataset_configuration.py
@@ -7,6 +7,7 @@ import numpy as np
 import zarr
 from hdmf import Container
 from hdmf.data_utils import DataIO
+from hdmf.utils import get_data_shape
 from hdmf_zarr import NWBZarrIO
 from pynwb import NWBHDF5IO, NWBFile
 from pynwb.base import DynamicTable, TimeSeriesReferenceVectorData
@@ -107,6 +108,7 @@ def get_default_dataset_io_configurations(
 
             for column in dynamic_table.columns:
                 candidate_dataset = column.data  # VectorData object
+                # noinspection PyTypeChecker
                 if _is_dataset_written_to_file(
                     candidate_dataset=candidate_dataset, backend=backend, existing_file=existing_file
                 ):
@@ -124,8 +126,15 @@ def get_default_dataset_io_configurations(
                 if isinstance(column, TimeSeriesReferenceVectorData):
                     continue
 
+                # Skip datasets with any zero-length axes
+                dataset_name = "data"
+                candidate_dataset = getattr(column, dataset_name)
+                full_shape = get_data_shape(data=candidate_dataset)
+                if any(axis_length == 0 for axis_length in full_shape):
+                    continue
+
                 dataset_io_configuration = DatasetIOConfigurationClass.from_neurodata_object(
-                    neurodata_object=column, dataset_name="data"
+                    neurodata_object=column, dataset_name=dataset_name
                 )
 
                 yield dataset_io_configuration
@@ -138,6 +147,7 @@ def get_default_dataset_io_configurations(
                 candidate_dataset = getattr(neurodata_object, known_dataset_field)
 
                 # Skip if already written to file
+                # noinspection PyTypeChecker
                 if _is_dataset_written_to_file(
                     candidate_dataset=candidate_dataset, backend=backend, existing_file=existing_file
                 ):
@@ -151,6 +161,12 @@ def get_default_dataset_io_configurations(
                 if isinstance(candidate_dataset, np.ndarray) and candidate_dataset.size == 0:
                     continue
 
+                # Skip datasets with any zero-length axes
+                candidate_dataset = getattr(neurodata_object, known_dataset_field)
+                full_shape = get_data_shape(data=candidate_dataset)
+                if any(axis_length == 0 for axis_length in full_shape):
+                    continue
+
                 dataset_io_configuration = DatasetIOConfigurationClass.from_neurodata_object(
                     neurodata_object=neurodata_object, dataset_name=known_dataset_field
                 )


Test patch:
diff --git a/tests/test_minimal/test_tools/test_backend_and_dataset_configuration/test_helpers/test_configure_backend_zero_length_axes.py b/tests/test_minimal/test_tools/test_backend_and_dataset_configuration/test_helpers/test_configure_backend_zero_length_axes.py
new file mode 100644
index 00000000..01045f7d
--- /dev/null
+++ b/tests/test_minimal/test_tools/test_backend_and_dataset_configuration/test_helpers/test_configure_backend_zero_length_axes.py
@@ -0,0 +1,135 @@
+"""
+Reported in https://github.com/catalystneuro/neuroconv/issues/891, a failure occurred because of a zero-length axis.
+
+These are specific tests for the additional skip condition that was added to the `get_default_dataset_io_configurations`
+helper function which is called by `BackendConfiguration.from_nwbfile(...)`.
+"""
+
+from pathlib import Path
+from typing import Callable, Literal, Tuple
+
+import numcodecs
+import numpy as np
+import pytest
+from hdmf.common import DynamicTable, VectorData
+from hdmf.data_utils import DataChunkIterator
+from numpy.testing import assert_array_equal
+from pynwb.testing.mock.base import mock_TimeSeries
+from pynwb.testing.mock.file import mock_NWBFile
+
+from neuroconv.tools.hdmf import SliceableDataChunkIterator
+from neuroconv.tools.nwb_helpers import (
+    BACKEND_NWB_IO,
+    configure_backend,
+    get_default_backend_configuration,
+)
+
+
+@pytest.fixture(scope="session")
+def integer_array(
+    seed: int = 0,
+    dtype: np.dtype = np.dtype("int16"),
+    shape: Tuple[int, int] = (12, 34),
+):
+    random_number_generator = np.random.default_rng(seed=seed)
+
+    low = np.iinfo(dtype).min
+    high = np.iinfo(dtype).max
+    return random_number_generator.integers(low=low, high=high, size=shape, dtype=dtype)
+
+
+@pytest.fixture(scope="session")
+def integer_array_with_zero_length_axis(
+    seed: int = 1,
+    dtype: np.dtype = np.dtype("int16"),
+    shape: Tuple[int, int] = (12, 0),  # 12 so it matches the dimension of the other column
+):
+    """Generate an array of integers with a zero-length axis."""
+    assert 0 in shape, "The shape must contain a zero-length axis."
+
+    random_number_generator = np.random.default_rng(seed=seed)
+
+    low = np.iinfo(dtype).min
+    high = np.iinfo(dtype).max
+    return random_number_generator.integers(low=low, high=high, size=shape, dtype=dtype)
+
+
+@pytest.mark.parametrize("backend", ["hdf5", "zarr"])
+def test_time_series_skip_zero_length_axis(
+    tmpdir: Path,
+    integer_array_with_zero_length_axis: np.ndarray,
+    backend: Literal["hdf5", "zarr"],
+):
+    data = integer_array_with_zero_length_axis
+
+    nwbfile = mock_NWBFile()
+    time_series = mock_TimeSeries(name="TestTimeSeries", data=data)
+    nwbfile.add_acquisition(time_series)
+
+    backend_configuration = get_default_backend_configuration(nwbfile=nwbfile, backend=backend)
+
+    assert len(backend_configuration.dataset_configurations) == 0
+
+    # dataset_configuration = backend_configuration.dataset_configurations["acquisition/TestTimeSeries/data"]
+    # configure_backend(nwbfile=nwbfile, backend_configuration=backend_configuration)
+    #
+    # nwbfile_path = str(tmpdir / f"test_configure_defaults_{case_name}_time_series.nwb.{backend}")
+    # with BACKEND_NWB_IO[backend](path=nwbfile_path, mode="w") as io:
+    #     io.write(nwbfile)
+    #
+    # with BACKEND_NWB_IO[backend](path=nwbfile_path, mode="r") as io:
+    #     written_nwbfile = io.read()
+    #     written_data = written_nwbfile.acquisition["TestTimeSeries"].data
+    #
+    #     assert written_data.chunks == dataset_configuration.chunk_shape
+    #
+    #     if backend == "hdf5":
+    #         assert written_data.compression == "gzip"
+    #     elif backend == "zarr":
+    #         assert written_data.compressor == numcodecs.GZip(level=1)
+    #
+    #     assert_array_equal(x=integer_array, y=written_data[:])
+
+
+@pytest.mark.parametrize("backend", ["hdf5", "zarr"])
+def test_dynamic_table_skip_zero_length_axis(
+    tmpdir: Path,
+    integer_array: np.ndarray,
+    integer_array_with_zero_length_axis: np.ndarray,
+    backend: Literal["hdf5", "zarr"],
+):
+    nwbfile = mock_NWBFile()
+    dynamic_table = DynamicTable(
+        name="TestDynamicTable",
+        description="",
+        columns=[
+            VectorData(name="TestColumn", description="", data=integer_array),
+            VectorData(name="TestZeroLengthColumn", description="", data=integer_array_with_zero_length_axis),
+        ],
+    )
+    nwbfile.add_acquisition(dynamic_table)
+
+    backend_configuration = get_default_backend_configuration(nwbfile=nwbfile, backend=backend)
+
+    assert "acquisition/TestDynamicTable/TestZeroLengthColumn/data" not in backend_configuration.dataset_configurations
+
+    dataset_configuration = backend_configuration.dataset_configurations["acquisition/TestDynamicTable/TestColumn/data"]
+    configure_backend(nwbfile=nwbfile, backend_configuration=backend_configuration)
+
+    nwbfile_path = str(tmpdir / f"test_configure_defaults_dynamic_table.nwb.{backend}")
+    NWB_IO = BACKEND_NWB_IO[backend]
+    with NWB_IO(path=nwbfile_path, mode="w") as io:
+        io.write(nwbfile)
+
+    with NWB_IO(path=nwbfile_path, mode="r") as io:
+        written_nwbfile = io.read()
+        written_data = written_nwbfile.acquisition["TestDynamicTable"]["TestColumn"].data
+
+        assert written_data.chunks == dataset_configuration.chunk_shape
+
+        if backend == "hdf5":
+            assert written_data.compression == "gzip"
+        elif backend == "zarr":
+            assert written_data.compressor == numcodecs.GZip(level=1)
+
+        assert_array_equal(x=integer_array, y=written_data[:])