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

SNOW-1011774: Adding scope filter (--in) to snow object list #681

Merged
merged 8 commits into from
Feb 6, 2024

Conversation

sfc-gh-davwang
Copy link
Contributor

@sfc-gh-davwang sfc-gh-davwang commented Jan 26, 2024

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

Added an option called 'scope' ('--in') to snow object list that allows users to filter by scope (database, schema, compute pool for services, application for application roles, etc.)

Example usage:
image
image

Number of Inputs Validation via Typer:
image

@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch 3 times, most recently from 8938f6e to 6bc7ab9 Compare January 26, 2024 18:56
@sfc-gh-davwang sfc-gh-davwang marked this pull request as ready for review January 26, 2024 19:45
@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch from 6bc7ab9 to 0eaf7d5 Compare January 30, 2024 23:02
tests_integration/test_object.py Outdated Show resolved Hide resolved
tests_integration/test_object.py Outdated Show resolved Hide resolved
tests_integration/test_object.py Outdated Show resolved Hide resolved
src/snowflake/cli/plugins/object/commands.py Show resolved Hide resolved
@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch from 0eaf7d5 to 87c88bc Compare January 31, 2024 08:13
@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch from bab8cf8 to e3e8a40 Compare February 1, 2024 00:51
sfc-gh-yiwang
sfc-gh-yiwang previously approved these changes Feb 1, 2024
Copy link
Collaborator

@sfc-gh-yiwang sfc-gh-yiwang left a comment

Choose a reason for hiding this comment

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

LGTM

@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch from e3e8a40 to d279164 Compare February 1, 2024 18:32
@sfc-gh-davwang sfc-gh-davwang self-assigned this Feb 5, 2024
@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch from d279164 to a5f0ce8 Compare February 5, 2024 18:35
RELEASE-NOTES.md Outdated Show resolved Hide resolved
@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch from a5f0ce8 to aac43ea Compare February 6, 2024 15:05
@sfc-gh-davwang sfc-gh-davwang force-pushed the SNOW-1011774-object-list-filter branch from aac43ea to 4a0d318 Compare February 6, 2024 15:18
@sfc-gh-davwang sfc-gh-davwang merged commit 92d88eb into main Feb 6, 2024
17 checks passed
@sfc-gh-davwang sfc-gh-davwang deleted the SNOW-1011774-object-list-filter branch February 6, 2024 15:32
sfc-gh-sichen pushed a commit that referenced this pull request Oct 17, 2024
* SNOW-1011774: Adding generic '--in' option to snow object list (not yet implemented)

* SNOW-1011774: Renaming InOption to ScopeOption for semantics. Changed implementation to use a tuple (<scope>, <name>) instead of parsing <scope>=<name> from a string.

* SNOW-1011774: Writing tests for 'list --in

* SNOW-1011774: Fixing type of scope option for 'object list' to be optional.

* SNOW-1011774: Changing default for '--in' to (None, None) due to lack of typer CLI support for optional tuples

* SNOW-1011774: Adding unit tests for _scope_callback, integration tests for 'object list' with scope

* SNOW-1011774: Adding validation that compute-pool scope is only used with services. Test cleanup.

* SNOW-1011774: Adding message checking when testing that a generic ClickException is raised
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.

4 participants