Skip to content
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

Fix type hint to transformations.preview #1784

Merged
merged 4 commits into from
May 30, 2024
Merged

Conversation

doctrino
Copy link
Contributor

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.

@doctrino doctrino requested review from a team as code owners May 27, 2024 11:05
@doctrino doctrino requested review from mattmurph9 and removed request for a team May 27, 2024 11:05
Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 50.39%. Comparing base (fbfd8cd) to head (694cf93).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1784   +/-   ##
=======================================
  Coverage   50.39%   50.39%           
=======================================
  Files         119      119           
  Lines       17502    17502           
=======================================
  Hits         8821     8821           
  Misses       8681     8681           
Files Coverage Δ
cognite/client/_api/transformations/__init__.py 41.00% <ø> (ø)
cognite/client/_version.py 0.00% <0.00%> (ø)

@@ -502,7 +502,7 @@ def preview(
self,
query: str | None = None,
convert_to_string: bool = False,
limit: int = 100,
limit: int | None = 100,
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Does it work to pass None for all?

  • Also, I see that the API spec uses 10k for inferSchemaLimit instead of the 1k in the SDK. Perhaps update as well?

  • Looks like timeout i also missing from the params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it work for None, will fix the other issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, I wonder why we call it preview if you can page through unlimited results? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think because you are actually not writing the results to the destination.

@doctrino doctrino force-pushed the fix-typehint-preview branch from 0e67182 to 3dec2da Compare May 30, 2024 05:27
@doctrino doctrino merged commit 0ad6ab1 into master May 30, 2024
12 checks passed
@doctrino doctrino deleted the fix-typehint-preview branch May 30, 2024 06:25
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