Skip to content

Sequence not String #1574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 19, 2024
Merged

Sequence not String #1574

merged 15 commits into from
Jan 19, 2024

Conversation

doctrino
Copy link
Contributor

@doctrino doctrino commented Jan 5, 2024

Description

Please describe the change you have made.

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • Changelog updated in CHANGELOG.md.
  • Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

Merging #1574 (8cd960e) into master (c83e41e) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1574      +/-   ##
==========================================
+ Coverage   91.56%   91.58%   +0.01%     
==========================================
  Files         120      120              
  Lines       16797    16830      +33     
==========================================
+ Hits        15381    15414      +33     
  Misses       1416     1416              
Files Coverage Δ
cognite/client/_api/assets.py 95.72% <100.00%> (+0.01%) ⬆️
cognite/client/_api/data_modeling/instances.py 82.87% <ø> (ø)
cognite/client/_api/data_sets.py 90.90% <100.00%> (+0.21%) ⬆️
cognite/client/_api/datapoint_tasks.py 95.93% <100.00%> (+<0.01%) ⬆️
cognite/client/_api/datapoints.py 97.65% <100.00%> (+<0.01%) ⬆️
cognite/client/_api/datapoints_subscriptions.py 100.00% <100.00%> (ø)
cognite/client/_api/diagrams.py 80.68% <100.00%> (+0.22%) ⬆️
cognite/client/_api/entity_matching.py 94.23% <100.00%> (+0.11%) ⬆️
cognite/client/_api/events.py 93.02% <100.00%> (+0.08%) ⬆️
cognite/client/_api/extractionpipelines.py 92.85% <100.00%> (+0.08%) ⬆️
... and 26 more

@doctrino doctrino marked this pull request as ready for review January 5, 2024 08:23
@doctrino doctrino requested review from a team as code owners January 5, 2024 08:23
Copy link
Contributor

@haakonvt haakonvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Found a few more:

  • expressions in SyntheticDatapointsAPI.query
  • properties in ThreeDRevisionsAPI.filter_nodes
  • labels in Label._load_list

Could you also fix this docstring:

template_names (SequenceNotStr[str] | None): (Optional[Sequence[str]]): Only include instances which has one of these values in their `template_name` field.

->

template_names (SequenceNotStr[str] | None): Only include instances which has one of these values in their `template_name` field.

CHANGELOG.md Outdated
Comment on lines 20 to 23
## [7.13.3] - 2024-01-11
### Changed
- Type hints `Sequence[str]` are now replaced with `SequenceNotStr[str]`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We doing this now? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking is to have released version consistent with the docs. However, you are right we do not do this, (and we release so often that it will not be outdated for long anyways). Removing as it is no change to functionality.

asset_subtree_ids: int | Sequence[int] | None = None,
asset_subtree_external_ids: str | Sequence[str] | None = None,
asset_subtree_external_ids: str | SequenceNotStr[str] | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that relevant when we also accept str, but won't hurt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check line endings on this file, looks suspicious

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another file for line ending check

# Conflicts:
#	CHANGELOG.md
#	cognite/client/_version.py
#	pyproject.toml
@doctrino doctrino requested a review from haakonvt January 19, 2024 08:15
Copy link
Contributor

@haakonvt haakonvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, does @erlendvollset want to have a look before merging?

@doctrino doctrino merged commit 8e69b43 into master Jan 19, 2024
@doctrino doctrino deleted the sequence-not-str branch January 19, 2024 12:03
johanlrdahl pushed a commit that referenced this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants