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

Expose the 'data_hashes' filter on a dataset #453

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

alexey-cord-tech
Copy link
Contributor

@alexey-cord-tech alexey-cord-tech commented Nov 1, 2023

Introduction and Explanation

See https://github.com/encord-team/cord-backend/pull/2686

Summary by CodeRabbit

Release Notes

New Feature

  • Added an optional data_hashes parameter to the list_data_rows function in the dataset module. This allows users to filter dataset rows based on a list of individual data unit hashes.

🎉 Here's to the code that's ever so bright,
Adding features that feel just right.
With data_hashes we take flight,
Filtering data with all our might! 🚀🌟

Copy link

github-actions bot commented Nov 1, 2023

Image description CodeRabbit

Walkthrough

The change introduces an optional data_hashes parameter to the list_data_rows function in the dataset module. This allows users to filter dataset rows based on specific data unit hashes, enhancing the flexibility and specificity of data retrieval without altering the external interface or behavior of the code.

Changes

Files Summary
encord/client.py, encord/dataset.py An optional data_hashes parameter has been added to the list_data_rows function. This parameter is included in the API request payload for filtering dataset rows based on individual data unit hashes. The change does not affect the signatures of exported functions, global data structures, or variables.

Notes

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Ignoring further reviews

  • Type @coderabbitai: ignore anywhere in the PR description to ignore further reviews from the bot.

Copy link

github-actions bot commented Nov 1, 2023

Unit test report

124 tests   113 ✔️  5s ⏱️
    1 suites    11 💤
    1 files        0

Results for commit 3ebd5d9.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 5601421 and 3ebd5d9 commits.
Files selected (2)
  • encord/client.py (3)
  • encord/dataset.py (3)
Files skipped from review due to trivial changes (1)
  • encord/dataset.py
Review comments generated (3)
  • Review: 1
  • LGTM: 2

Comment on lines 374 to 380
if data_types is not None
else None,
"dataset_access_settings": dataclasses.asdict(self._dataset_access_settings),
"data_hashes": data_hashes,
},
),
)
Copy link

Choose a reason for hiding this comment

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

Image description CodeRabbit

The data_hashes parameter is directly added to the request payload without any null check. This could potentially send a None value in the request if data_hashes is not provided, which might not be handled correctly by the server and could lead to unexpected behavior or errors.

Suggested change
if data_types is not None
else None,
"dataset_access_settings": dataclasses.asdict(self._dataset_access_settings),
"data_hashes": data_hashes,
},
),
)
if data_types is not None
else None,
"dataset_access_settings": dataclasses.asdict(self._dataset_access_settings),
"data_hashes": data_hashes if data_hashes is not None else [],
},
),
)

@alexey-cord-tech alexey-cord-tech merged commit 93ce36d into master Nov 2, 2023
4 checks passed
@alexey-cord-tech alexey-cord-tech deleted the ak/list-data-rows-individual-items branch November 2, 2023 11:21
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.

3 participants