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: query config value must be converted to dict #1016

Conversation

wimvanleuven
Copy link

@wimvanleuven wimvanleuven commented Jun 23, 2024

to be usable by URL.create()

Describe your changes

The fix mainly isolates the parsing of a configuration section in a separate function, so that in can be reused at the points where URL.create(**section) is called.

The parsing mainly ensure that a query attributed is also correctly converted to a dictionary or something else by parsing the value as a python string.

This seemed the least impactful change, while fixing the bugs related to the query parameter.

Issue number

Closes #1015

Checklist before requesting a review


📚 Documentation preview 📚: https://jupysql--1016.org.readthedocs.build/en/1016/

@wimvanleuven wimvanleuven requested a review from edublancas as a code owner June 23, 2024 16:09
@edublancas
Copy link

@neelasha23, please review this and check the CI

I took a brief look and it seems like it's an issue with the DuckDB version (an update probably broke things)

@wimvanleuven
Copy link
Author

OK for me to help fix things with some guidance, but prbly better on a separate branch?

@neelasha23
Copy link

neelasha23 commented Jun 26, 2024

I added a basic sqlite connection in the format mentioned and it worked.

I have fixed most of the CI issues except one. Please take a look at the changes here:

  1. Unpin the DuckDB version
  2. Change the MySQL image
  3. The JSON arrow operator related tests are failing because for single operators output returned is no more in the string format. So I fixed the related tests in test_magic.py.

I still see this test failing: src/tests/integration/test_generic_db_operations.py::test_query_snippet_invalid_function_error_message[with-typo-oracle] . I'm not sure why this test is failing. @wimvanleuven Please check if you can fix it else maybe we can mark it as xfail for now and open an issue to solve it? Ensure your tests also pass in the CI. I think we should also add an example in the docs

Thoughts? @edublancas

src/sql/parse.py Outdated Show resolved Hide resolved
@edublancas
Copy link

@neelasha23 I've merged your PR to fix the CI

@wimvanleuven feel free to rebase so you get the CI fixes

I still see this test failing: src/tests/integration/test_generic_db_operations.py::test_query_snippet_invalid_function_error_message[with-typo-oracle] . I'm not sure why this test is failing. @wimvanleuven Please check if you can fix it else maybe we can mark it as xfail for now and open an issue to solve it? Ensure your tests also pass in the CI. I think we should also add an example in the docs

yeah we can add an xfail and open an issue, we can tackle it later

yes, I think we should add an example to the docs

@wimvanleuven
Copy link
Author

@edublancas

  • all tests pass,
  • the parse function was renamed as per @neelasha23 request and
  • an example configuration with query parameters is in the docs.

setup.py Outdated Show resolved Hide resolved
src/sql/_testing.py Outdated Show resolved Hide resolved
src/tests/test_magic.py Outdated Show resolved Hide resolved
@wimvanleuven wimvanleuven requested a review from neelasha23 July 2, 2024 20:39
@wimvanleuven
Copy link
Author

I noticed the read the docs action failed ... how to retrigger?

@edublancas
Copy link

I re-ran the CI, all passing now!

@neelasha23 please give a final check

Copy link

@neelasha23 neelasha23 left a comment

Choose a reason for hiding this comment

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

lg!

@edublancas edublancas merged commit bdc2e60 into ploomber:master Jul 3, 2024
22 checks passed
@edublancas
Copy link

@wimvanleuven thanks so much! I'll do a release shortly!

@wimvanleuven wimvanleuven deleted the fix_query_connections_ini_param_as_dict branch July 4, 2024 10:01
@wimvanleuven
Copy link
Author

@edublancas I don't want to rush you, but could you give an time horizon for the release, so we can plan our work accordingly? Thank you so much for the productive collab!

@neelasha23
Copy link

@edublancas I don't want to rush you, but could you give an time horizon for the release

It's released @wimvanleuven

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.

Setting query parameter in connections.ini triggers a ValueError
3 participants