معرفی شرکت ها


dune-query-translator-0.6.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

-
ویژگی مقدار
سیستم عامل -
نام فایل dune-query-translator-0.6.0
نام dune-query-translator
نسخه کتابخانه 0.6.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Vegard Stikbakke
ایمیل نویسنده vegard@dune.com
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/dune-query-translator/
مجوز -
# Dune Query Translator A library we use in the Dune app to translate Dune queries from PostgreSQL and Spark SQL to DuneSQL. A query is translated through two steps. 1. We use [SQLGlot](https://github.com/tobymao/sqlglot) to transpile the query. This is an excellent tool which parses a SQL query into an Abstract Syntax Tree (AST), and then translates it to a different dialect. We use it to translate from Spark SQL to DuneSQL, and from PostgreSQL to DuneSQL. 2. We pass the query through custom rules to make additional changes to the query. Examples of such rules are - mapping known changes in table names from the legacy Postgres datasets to corresponding table names in DuneSQL - translating string literals '0x...' to 0x... in DuneSQL, since we [support native hex literals](https://dune.com/docs/query/DuneSQL-reference/datatypes/#varbinary). ## Getting started Install with ``` pip install dune-query-translator ``` Now import the `migrate_` functions in your code: ```python from dune.translate import migrate_spark, migrate_postgres ``` with function signatures ```python def migrate_spark(query: str) -> str: ... def migrate_postgres(query: str, dataset: str) -> str: ... ``` ## Contributing Contributions are very welcome! Please open an issue or a PR, and we will get back to you as soon as we can. ## Development Install with ``` poetry install ``` If the Ruff linter complains, running the following and committing the changes should suffice ``` poetry run ruff . --fix poetry run black . ``` Run tests with ``` poetry run pytest ``` We test on examples in the `test_cases` directory. To force an update of the expected outputs, run the `update_expected_outputs` script like below ``` poetry run python tests/update_expected_outputs.py ```


نیازمندی

مقدار نام
>=11.4.4,<12.0.0 sqlglot


زبان مورد نیاز

مقدار نام
>=3.11,<4.0 Python


نحوه نصب


نصب پکیج whl dune-query-translator-0.6.0:

    pip install dune-query-translator-0.6.0.whl


نصب پکیج tar.gz dune-query-translator-0.6.0:

    pip install dune-query-translator-0.6.0.tar.gz