-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(source create snowflake): Support format --account {org}.{account}
#206
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
@@ -26,7 +26,7 @@ dialoguer = "0.10.4" | |||
directories = "5.0.1" | |||
inquire = "0.6.2" | |||
prost = "0.11.9" | |||
regress = "0.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was motivated by 0.6.0 wrongly rejecting a valid pattern:
^(?<org_name>[a-zA-Z][a-zA-Z0-9]*)[.-](?<account_name>[a-zA-Z_]+)$
thread 'main' panicked at src/command/snowflake.rs:34:6:
called `Result::unwrap()` on an `Err` value: Error { text: "Invalid token at named capture group identifier" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
// SAFETY: Regex match implies that both groups matched. | ||
let org_name = &account_name[result.named_group("org_name").unwrap()]; | ||
let account_name = &account_name[result.named_group("account_name").unwrap()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going forward, I'd like to accompany any non-trivial .unwrap()
calls with // SAFETY
comments, explaining why they won't panic. The hope is that this practice will promote quality and make it easier to audit the codebase for any preexisting, unjustified unwrapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL: Safety comments.
908beac
to
373912c
Compare
--account {org}.{account}
format when creating Snowflake sourcesTest plan
Failure:
Success:
&& verifying the expected values were persisted: