Skip to content

Commit

Permalink
__call__ doesnt use yield
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonvt committed Aug 14, 2023
1 parent ec156a2 commit 99d9c43
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cognite/client/_api/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __call__(
external_id_prefix=external_id_prefix,
).dump(camel_case=True)

return self._list_generator(
yield from self._list_generator(
list_cls=AssetList,
resource_cls=Asset,
method="POST",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/data_modeling/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __call__(
Container | ContainerList: yields Container one by one if chunk_size is not specified, else ContainerList objects.
"""
filter = ContainerFilter(space, include_global)
return self._list_generator(
yield from self._list_generator(
list_cls=ContainerList,
resource_cls=Container,
method="GET",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/data_modeling/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __call__(
"""
filter = DataModelFilter(space, inline_views, all_versions, include_global)

return self._list_generator(
yield from self._list_generator(
list_cls=DataModelList,
resource_cls=DataModel,
method="GET",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/data_modeling/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __call__(
Yields:
Union[Space, SpaceList]: yields Space one by one if chunk_size is not specified, else SpaceList objects.
"""
return self._list_generator(
yield from self._list_generator(
list_cls=SpaceList,
resource_cls=Space,
method="GET",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/data_modeling/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __call__(
Union[View, ViewList]: yields View one by one if chunk_size is not specified, else ViewList objects.
"""
filter_ = ViewFilter(space, include_inherited_properties, all_versions, include_global)
return self._list_generator(
yield from self._list_generator(
list_cls=ViewList,
resource_cls=View,
method="GET",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/data_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __call__(
external_id_prefix=external_id_prefix,
write_protected=write_protected,
).dump(camel_case=True)
return self._list_generator(
yield from self._list_generator(
list_cls=DataSetList, resource_cls=DataSet, method="POST", chunk_size=chunk_size, filter=filter, limit=limit
)

Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __call__(
type=type,
subtype=subtype,
).dump(camel_case=True)
return self._list_generator(
yield from self._list_generator(
list_cls=EventList,
resource_cls=Event,
method="POST",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __call__(
uploaded=uploaded,
data_set_ids=data_set_ids_processed,
).dump(camel_case=True)
return self._list_generator(
yield from self._list_generator(
list_cls=FileMetadataList,
resource_cls=FileMetadata,
method="POST",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __call__(
filter = LabelDefinitionFilter(
name=name, external_id_prefix=external_id_prefix, data_set_ids=data_set_ids_processed
).dump(camel_case=True)
return self._list_generator(
yield from self._list_generator(
list_cls=LabelDefinitionList,
resource_cls=LabelDefinition,
method="POST",
Expand Down
4 changes: 2 additions & 2 deletions cognite/client/_api/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __call__(
chunk_size (int, optional): Number of dbs to return in each chunk. Defaults to yielding one db a time.
limit (int, optional): Maximum number of dbs to return. Defaults to return all items.
"""
return self._list_generator(
yield from self._list_generator(
list_cls=DatabaseList, resource_cls=Database, chunk_size=chunk_size, method="GET", limit=limit
)

Expand Down Expand Up @@ -327,7 +327,7 @@ def __call__(
max_last_updated_time (int): Rows must have been last updated before this time (inclusive). ms since epoch.
columns (List[str]): List of column keys. Set to `None` for retrieving all, use [] to retrieve only row keys.
"""
return self._list_generator(
yield from self._list_generator(
list_cls=RowList,
resource_cls=Row,
resource_path=utils._auxiliary.interpolate_and_url_encode(self._RESOURCE_PATH, db_name, table_name),
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __call__(
"target_external_ids, only list is supported"
)

return self._list_generator(
yield from self._list_generator(
list_cls=RelationshipList,
resource_cls=Relationship,
method="POST",
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __call__(
last_updated_time=last_updated_time,
data_set_ids=data_set_ids_processed,
).dump(camel_case=True)
return self._list_generator(
yield from self._list_generator(
list_cls=SequenceList,
resource_cls=Sequence,
method="POST",
Expand Down
4 changes: 2 additions & 2 deletions cognite/client/_api/three_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __call__(
Yields:
Union[ThreeDModel, ThreeDModelList]: yields ThreeDModel one by one if chunk is not specified, else ThreeDModelList objects.
"""
return self._list_generator(
yield from self._list_generator(
list_cls=ThreeDModelList,
resource_cls=ThreeDModel,
method="GET",
Expand Down Expand Up @@ -228,7 +228,7 @@ def __call__(
Union[ThreeDModelRevision, ThreeDModelRevisionList]: yields ThreeDModelRevision one by one if chunk is not
specified, else ThreeDModelRevisionList objects.
"""
return self._list_generator(
yield from self._list_generator(
list_cls=ThreeDModelRevisionList,
resource_cls=ThreeDModelRevision,
resource_path=utils._auxiliary.interpolate_and_url_encode(self._RESOURCE_PATH, model_id),
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_api/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __call__(
last_updated_time=last_updated_time,
external_id_prefix=external_id_prefix,
).dump(camel_case=True)
return self._list_generator(
yield from self._list_generator(
list_cls=TimeSeriesList,
resource_cls=TimeSeries,
method="POST",
Expand Down

0 comments on commit 99d9c43

Please sign in to comment.