Skip to content

Commit

Permalink
MNT: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
genematx committed Mar 10, 2025
1 parent afbdc78 commit 24a9366
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tiled/_tests/test_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,4 +764,4 @@ def test_composite_table_column_array_key_collision(tree):
y = client.create_container(key="y", flat=True)
y.write_array(arr, key="A")
with fail_with_status_code(HTTP_409_CONFLICT):
y.write_dataframe(df, key="table1")
y.write_dataframe(df, key="table1")
11 changes: 9 additions & 2 deletions tiled/catalog/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,16 @@ async def create_node(
assert len(data_sources) == 1
if data_sources[0].structure_family == StructureFamily.table:
new_keys = data_sources[0].structure.columns
elif data_sources[0].structure_family in [StructureFamily.array, StructureFamily.awkward, StructureFamily.sparse]:
elif data_sources[0].structure_family in [
StructureFamily.array,
StructureFamily.awkward,
StructureFamily.sparse,
]:
new_keys = [key]
else:
raise ValueError(f"Unsupported structure family: {data_sources[0].structure_family}")
raise ValueError(
f"Unsupported structure family: {data_sources[0].structure_family}"
)

# Get all keys and columns names in the Composite node
flat_keys = []
Expand All @@ -1053,6 +1059,7 @@ async def create_node(
structure_family, metadata, key=key, specs=specs, data_sources=data_sources
)


class CatalogArrayAdapter(CatalogNodeAdapter):
async def read(self, *args, **kwargs):
if not self.data_sources:
Expand Down
8 changes: 3 additions & 5 deletions tiled/client/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,6 @@ def write_dataframe(


class Composite(Container):

@property
def _contents(self, maxlen=None):
result = {}
Expand All @@ -1071,7 +1070,7 @@ def _contents(self, maxlen=None):
},
)
).json()
result.update({item['id'] : item for item in content["data"]})
result.update({item["id"]: item for item in content["data"]})

next_page_url = content["links"]["next"]

Expand All @@ -1088,7 +1087,7 @@ def _flat_keys_mapping(self):
result[item["id"]] = item["id"]

return result

@property
def parts(self):
return CompositeContents(self)
Expand Down Expand Up @@ -1140,10 +1139,9 @@ def __getitem__(self, key):
)

if tail:
return client['/'.join(tail)]
return client["/".join(tail)]
else:
return client


def __iter__(self):
for key in self._contents:
Expand Down

0 comments on commit 24a9366

Please sign in to comment.