Uh oh!
There was an error while loading. Please reload this page.
Use str type for driver and name in HiveDialect - #450
Merged
Conversation
PyHive's HiveDialect usage of bytes for the name and driver fields is not the norm is causing issues upstream: apache/superset#22316 Even other dialects within PyHive use strings. SQLAlchemy does not strictly require a string, but all the stock dialects return a string, so I figure it is heavily implied. I think the risk of breaking something upstream with this change is low (but it is there ofc). I figure in most cases we just make someone's `str(dialect.driver)` expression redundant. Examples for some of the other stock sqlalchemy dialects (name and driver fields using str): https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/sqlite/pysqlite.py#L501https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/sqlite/base.py#L1891https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/base.py#L2383https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/mysqldb.py#L113https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/pymysql.py#L59
3 tasks
bkyryliuk
commented
Apr 30, 2023
Contributor
@Usiel can you confirm that apache/superset#22316 is addressed with this PR ? |
Usiel
commented
Apr 30, 2023
ContributorAuthor
Yes, this fixes the issue on Superset (I also made a comment on that issue). |
kashifjavedaddo
commented
May 9, 2023
@Usiel so how do i get this fixed on my installation. do I need to upgrade my existing superset 2.1.0 installation ? Please update with exact steps to get this done. |
Usiel
commented
May 10, 2023
ContributorAuthor
Thanks for the merge @bkyryliuk! Will there be a release for this on PyPI? |
Merged
betodealmeida added a commit
to preset-io/PyHive
that referenced
this pull request
Aug 8, 2024
* feat: add HTTP and HTTPS to hive (dropbox#385) * feat: add https protocol * support HTTP * fix: make hive https py2 compat (dropbox#389) * fix: make hive https py2 compat * fix lint * Update README.rst (dropbox#423) * chore: rename Trino entry point (dropbox#428) * Support for Presto decimals (dropbox#430) * Support for Presto decimals * lower * Use str type for driver and name in HiveDialect (dropbox#450) PyHive's HiveDialect usage of bytes for the name and driver fields is not the norm is causing issues upstream: apache/superset#22316 Even other dialects within PyHive use strings. SQLAlchemy does not strictly require a string, but all the stock dialects return a string, so I figure it is heavily implied. I think the risk of breaking something upstream with this change is low (but it is there ofc). I figure in most cases we just make someone's `str(dialect.driver)` expression redundant. Examples for some of the other stock sqlalchemy dialects (name and driver fields using str): https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/sqlite/pysqlite.py#L501https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/sqlite/base.py#L1891https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/base.py#L2383https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/mysqldb.py#L113https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/pymysql.py#L59 * Correcting Iterable import for python 3.10 (dropbox#451) * changing drivers to support hive, presto and trino with sqlalchemy>=2.0 (dropbox#448) * Revert "changing drivers to support hive, presto and trino with sqlalchemy>=2.0 (dropbox#448)" (dropbox#452) This reverts commit b0206d3. * Update __init__.py (dropbox#453) dropbox@1c1da8bdropbox@1f99552 * use pure-sasl with python 3.11 (dropbox#454) * minimal changes for sqlalchemy 2.0 support (dropbox#457) * update readme to reflect recent changes (dropbox#459) * Update README.rst (dropbox#475) * Update README.rst (dropbox#476) * feat: JWT support * Add CI to build package --------- Co-authored-by: Daniel Vaz Gaspar <danielvazgaspar@gmail.com> Co-authored-by: Bogdan <b.kyryliuk@gmail.com> Co-authored-by: serenajiang <serena.jiang@airbnb.com> Co-authored-by: Usiel Riedl <usiel.riedl@gmail.com> Co-authored-by: Multazim Deshmukh <57723564+mdeshmu@users.noreply.github.com> Co-authored-by: nicholas-miles <nicholas.miles6@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyHive's HiveDialect usage of bytes for the name and driver fields is not the norm is causing issues upstream: apache/superset#22316
Other dialects within PyHive already use strings. While SQLAlchemy does not strictly require a string, all the stock dialects return a string, so I figure it is heavily implied.
I think the risk of breaking something upstream with this change is low (but it is there ofc). I figure in most cases we just make someone's
str(dialect.driver)expression redundant. To be extra safe we could just go for a major version bump.Examples for some of the other stock sqlalchemy dialects (name and driver fields using str): https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/sqlite/pysqlite.py#L501https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/sqlite/base.py#L1891https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/base.py#L2383https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/mysqldb.py#L113https://github.com/zzzeek/sqlalchemy/blob/main/lib/sqlalchemy/dialects/mysql/pymysql.py#L59
PS: I have submitted the CLA.