-
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: add support for overriding context.engine
by magic argument
#60
Conversation
bigquery_magics/bigquery.py
Outdated
use_bigframes_engine = args.engine or context.engine | ||
|
||
if use_bigframes_engine == "bigframes": |
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 name feels off to me. Like it would be a boolean but it's not. How about engine_or_default
use_bigframes_engine = args.engine or context.engine | |
if use_bigframes_engine == "bigframes": | |
engine_or_default = args.engine or context.engine | |
if engine_or_default == "bigframes": |
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.
Good catch. I named it simply"engine"
tests/unit/test_bigquery.py
Outdated
@@ -1920,7 +1932,33 @@ def test_big_query_magic_bigframes(): | |||
assert bpd.options.bigquery.project == bigquery_magics.context.project | |||
|
|||
|
|||
@pytest.mark.usefixtures("ipython_interactive", "mock_credentials", "bigframes_engine") | |||
@pytest.mark.usefixtures("ipython_interactive", "mock_credentials") | |||
def test_big_query_magic_bigframes_set_in_args(): |
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.
Nit: big_query -> bigquery
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.
Right. Updated the name here and for other methods too.
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.
A few nits. Looks good once addressed.
Fixes #16 🦕