sqlframe 1.3.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlframe-1.3.0 → sqlframe-1.5.0}/Makefile +1 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/PKG-INFO +12 -6
- {sqlframe-1.3.0 → sqlframe-1.5.0}/README.md +11 -5
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/bigquery.md +0 -1
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/configuration.md +45 -32
- sqlframe-1.5.0/docs/snowflake.md +492 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/setup.py +1 -1
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/_version.py +2 -2
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/column.py +7 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/dataframe.py +61 -17
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/function_alternatives.py +371 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/functions.py +49 -43
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/normalize.py +9 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/session.py +2 -0
- sqlframe-1.5.0/sqlframe/snowflake/functions.py +63 -0
- sqlframe-1.5.0/sqlframe/snowflake/functions.pyi +192 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/session.py +11 -4
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe.egg-info/PKG-INFO +12 -6
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe.egg-info/SOURCES.txt +2 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe.egg-info/requires.txt +1 -1
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/test_int_functions.py +367 -182
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/fixtures.py +15 -15
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/test_int_dataframe_stats.py +8 -2
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_functions.py +4 -0
- sqlframe-1.3.0/sqlframe/snowflake/functions.py +0 -18
- {sqlframe-1.3.0 → sqlframe-1.5.0}/.github/CODEOWNERS +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/.github/workflows/main.workflow.yaml +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/.github/workflows/publish.workflow.yaml +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/.gitignore +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/.pre-commit-config.yaml +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/.readthedocs.yaml +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/LICENSE +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/blogs/images/but_wait_theres_more.gif +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/blogs/images/cake.gif +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/blogs/images/you_get_pyspark_api.gif +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/blogs/sqlframe_universal_dataframe_api.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/bigquery.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/duckdb.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/images/SF.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/images/favicon.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/images/favicon_old.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/images/sqlframe_diagram.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/images/sqlframe_logo.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/docs/postgres.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/duckdb.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/images/SF.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/images/favicon.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/images/favicon_old.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/images/sqlframe_diagram.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/images/sqlframe_logo.png +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/index.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/postgres.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/requirements.txt +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/standalone.md +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/docs/stylesheets/extra.css +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/mkdocs.yml +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/pytest.ini +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/renovate.json +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/setup.cfg +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/LICENSE +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/_typing.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/decorators.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/exceptions.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/mixins/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/mixins/catalog_mixins.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/mixins/dataframe_mixins.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/mixins/readwriter_mixins.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/operations.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/readerwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/transforms.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/util.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/base/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/functions.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/functions.pyi +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/readwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/bigquery/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/functions.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/functions.pyi +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/readwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/duckdb/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/functions.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/functions.pyi +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/readwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/postgres/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/functions.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/readwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/redshift/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/readwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/snowflake/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/functions.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/readwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/spark/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/functions.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/group.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/readwriter.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe/standalone/window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe.egg-info/dependency_links.txt +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/sqlframe.egg-info/top_level.txt +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/common_fixtures.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/conftest.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/fixtures/employee.csv +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/fixtures/employee.json +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/fixtures/employee.parquet +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/fixtures/employee_extra_line.csv +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/bigquery/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/bigquery/test_bigquery_catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/bigquery/test_bigquery_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/duck/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/duck/test_duckdb_catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/duck/test_duckdb_dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/duck/test_duckdb_reader.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/duck/test_duckdb_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/postgres/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/postgres/test_postgres_catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/postgres/test_postgres_dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/postgres/test_postgres_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/redshift/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/redshift/test_redshift_catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/redshift/test_redshift_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/snowflake/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/snowflake/test_snowflake_catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/snowflake/test_snowflake_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/spark/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/spark/test_spark_catalog.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/test_engine_dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/test_engine_reader.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/test_engine_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/engines/test_engine_writer.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/test_int_dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/test_int_grouped_data.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/integration/test_int_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/__init__.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/fixtures.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_column.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_dataframe.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_dataframe_writer.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_session.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_session_case_sensitivity.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_types.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/standalone/test_window.py +0 -0
- {sqlframe-1.3.0 → sqlframe-1.5.0}/tests/unit/test_util.py +0 -0
|
@@ -29,6 +29,7 @@ stubs:
|
|
|
29
29
|
stubgen sqlframe/bigquery/functions.py --output ./ --inspect-mode
|
|
30
30
|
stubgen sqlframe/duckdb/functions.py --output ./ --inspect-mode
|
|
31
31
|
stubgen sqlframe/postgres/functions.py --output ./ --inspect-mode
|
|
32
|
+
stubgen sqlframe/snowflake/functions.py --output ./ --inspect-mode
|
|
32
33
|
|
|
33
34
|
package:
|
|
34
35
|
pip3 install wheel && python3 setup.py sdist bdist_wheel
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sqlframe
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: Taking the Spark out of PySpark by converting to SQL
|
|
5
5
|
Home-page: https://github.com/eakmanrq/sqlframe
|
|
6
6
|
Author: Ryan Eakman
|
|
@@ -29,19 +29,19 @@ Provides-Extra: spark
|
|
|
29
29
|
License-File: LICENSE
|
|
30
30
|
|
|
31
31
|
<div align="center">
|
|
32
|
-
<img src="https://sqlframe.readthedocs.io/en/
|
|
32
|
+
<img src="https://sqlframe.readthedocs.io/en/stable/docs/images/sqlframe_logo.png" alt="SQLFrame Logo" width="400"/>
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
SQLFrame implements the PySpark DataFrame API in order to enable running transformation pipelines directly on database engines - no Spark clusters or dependencies required.
|
|
36
36
|
|
|
37
37
|
SQLFrame currently supports the following engines (many more in development):
|
|
38
38
|
|
|
39
|
-
* [BigQuery](https://sqlframe.readthedocs.io/en/
|
|
40
|
-
* [DuckDB](https://sqlframe.readthedocs.io/en/
|
|
41
|
-
* [Postgres](https://sqlframe.readthedocs.io/en/
|
|
39
|
+
* [BigQuery](https://sqlframe.readthedocs.io/en/stable/bigquery/)
|
|
40
|
+
* [DuckDB](https://sqlframe.readthedocs.io/en/stable/duckdb)
|
|
41
|
+
* [Postgres](https://sqlframe.readthedocs.io/en/stable/postgres)
|
|
42
42
|
|
|
43
43
|
SQLFrame also has a "Standalone" session that be used to generate SQL without any connection to a database engine.
|
|
44
|
-
* [Standalone](https://sqlframe.readthedocs.io/en/
|
|
44
|
+
* [Standalone](https://sqlframe.readthedocs.io/en/stable/standalone)
|
|
45
45
|
|
|
46
46
|
SQLFrame is great for:
|
|
47
47
|
|
|
@@ -64,6 +64,12 @@ pip install sqlframe
|
|
|
64
64
|
|
|
65
65
|
See specific engine documentation for additional setup instructions.
|
|
66
66
|
|
|
67
|
+
## Configuration
|
|
68
|
+
|
|
69
|
+
SQLFrame generates consistently accurate yet complex SQL for engine execution.
|
|
70
|
+
However, when using df.sql(), it produces more human-readable SQL.
|
|
71
|
+
For details on how to configure this output and leverage OpenAI to enhance the SQL, see [Generated SQL Configuration](https://sqlframe.readthedocs.io/en/stable/configuration/#generated-sql).
|
|
72
|
+
|
|
67
73
|
## Example Usage
|
|
68
74
|
|
|
69
75
|
```python
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="https://sqlframe.readthedocs.io/en/
|
|
2
|
+
<img src="https://sqlframe.readthedocs.io/en/stable/docs/images/sqlframe_logo.png" alt="SQLFrame Logo" width="400"/>
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
SQLFrame implements the PySpark DataFrame API in order to enable running transformation pipelines directly on database engines - no Spark clusters or dependencies required.
|
|
6
6
|
|
|
7
7
|
SQLFrame currently supports the following engines (many more in development):
|
|
8
8
|
|
|
9
|
-
* [BigQuery](https://sqlframe.readthedocs.io/en/
|
|
10
|
-
* [DuckDB](https://sqlframe.readthedocs.io/en/
|
|
11
|
-
* [Postgres](https://sqlframe.readthedocs.io/en/
|
|
9
|
+
* [BigQuery](https://sqlframe.readthedocs.io/en/stable/bigquery/)
|
|
10
|
+
* [DuckDB](https://sqlframe.readthedocs.io/en/stable/duckdb)
|
|
11
|
+
* [Postgres](https://sqlframe.readthedocs.io/en/stable/postgres)
|
|
12
12
|
|
|
13
13
|
SQLFrame also has a "Standalone" session that be used to generate SQL without any connection to a database engine.
|
|
14
|
-
* [Standalone](https://sqlframe.readthedocs.io/en/
|
|
14
|
+
* [Standalone](https://sqlframe.readthedocs.io/en/stable/standalone)
|
|
15
15
|
|
|
16
16
|
SQLFrame is great for:
|
|
17
17
|
|
|
@@ -34,6 +34,12 @@ pip install sqlframe
|
|
|
34
34
|
|
|
35
35
|
See specific engine documentation for additional setup instructions.
|
|
36
36
|
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
SQLFrame generates consistently accurate yet complex SQL for engine execution.
|
|
40
|
+
However, when using df.sql(), it produces more human-readable SQL.
|
|
41
|
+
For details on how to configure this output and leverage OpenAI to enhance the SQL, see [Generated SQL Configuration](https://sqlframe.readthedocs.io/en/stable/configuration/#generated-sql).
|
|
42
|
+
|
|
37
43
|
## Example Usage
|
|
38
44
|
|
|
39
45
|
```python
|
|
@@ -385,7 +385,6 @@ print(session.catalog.listColumns(table_path))
|
|
|
385
385
|
* [soundex](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.soundex.html)
|
|
386
386
|
* [split](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split.html)
|
|
387
387
|
* Regular expressions not supported
|
|
388
|
-
* [sqlglot_expression](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.sqlglot_expression.html)
|
|
389
388
|
* [sqrt](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.sqrt.html)
|
|
390
389
|
* [stddev](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.stddev.html)
|
|
391
390
|
* [stddev_pop](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.stddev_pop.html)
|
|
@@ -184,46 +184,59 @@ The dialect of the generated SQL will be based on the session's dialect. However
|
|
|
184
184
|
df.sql(dialect="bigquery")
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
### OpenAI
|
|
187
|
+
### OpenAI Enrichment
|
|
188
188
|
|
|
189
|
-
OpenAI's models can be used to enrich the generated SQL to make it more human-like.
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
OpenAI's models can be used to enrich the generated SQL to make it more human-like.
|
|
190
|
+
You can have it just provide more readable CTE names or you can have it try to make the whole SQL statement more readable.
|
|
191
|
+
|
|
192
|
+
#### Example
|
|
192
193
|
|
|
193
194
|
```python
|
|
194
195
|
# create session and `df` like normal
|
|
195
196
|
# The model to use defaults to `gpt-4o` but can be changed by passing a string to the `openai_model` parameter.
|
|
196
|
-
>>> df.sql(
|
|
197
|
-
WITH
|
|
198
|
-
SELECT
|
|
199
|
-
year,
|
|
200
|
-
ever_born
|
|
201
|
-
FROM `bigquery-public-data`.`samples`.`natality`
|
|
202
|
-
), single_child_families AS (
|
|
197
|
+
>>> df.sql(openai_config={"mode": "cte_only", "model": "gpt-3.5-turbo"})
|
|
198
|
+
WITH `single_child_families_by_year` AS (
|
|
203
199
|
SELECT
|
|
204
|
-
year
|
|
205
|
-
COUNT(*) AS num_single_child_families
|
|
206
|
-
FROM
|
|
207
|
-
WHERE
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
num_single_child_families,
|
|
213
|
-
LAG(num_single_child_families, 1) OVER (ORDER BY year) AS last_year_num_single_child_families
|
|
214
|
-
FROM single_child_families
|
|
215
|
-
), percent_change_families AS (
|
|
200
|
+
`natality`.`year` AS `year`,
|
|
201
|
+
COUNT(*) AS `num_single_child_families`
|
|
202
|
+
FROM `bigquery-public-data`.`samples`.`natality` AS `natality`
|
|
203
|
+
WHERE
|
|
204
|
+
`natality`.`ever_born` = 1
|
|
205
|
+
GROUP BY
|
|
206
|
+
`natality`.`year`
|
|
207
|
+
), `families_with_percent_change` AS (
|
|
216
208
|
SELECT
|
|
217
|
-
year
|
|
218
|
-
num_single_child_families
|
|
219
|
-
(
|
|
220
|
-
FROM
|
|
221
|
-
ORDER BY ABS(percent_change) DESC
|
|
209
|
+
`single_child_families_by_year`.`year` AS `year`,
|
|
210
|
+
`single_child_families_by_year`.`num_single_child_families` AS `num_single_child_families`,
|
|
211
|
+
LAG(`single_child_families_by_year`.`num_single_child_families`, 1) OVER (ORDER BY `single_child_families_by_year`.`year`) AS `last_year_num_single_child_families`
|
|
212
|
+
FROM `single_child_families_by_year` AS `single_child_families_by_year`
|
|
222
213
|
)
|
|
223
214
|
SELECT
|
|
224
|
-
year
|
|
225
|
-
FORMAT('%\'.0f', ROUND(CAST(num_single_child_families AS FLOAT64), 0)) AS `new families single child`,
|
|
226
|
-
FORMAT(
|
|
227
|
-
|
|
215
|
+
`families_with_percent_change`.`year` AS `year`,
|
|
216
|
+
FORMAT('%\'.0f', ROUND(CAST(`families_with_percent_change`.`num_single_child_families` AS FLOAT64), 0)) AS `new families single child`,
|
|
217
|
+
FORMAT(
|
|
218
|
+
'%\'.2f',
|
|
219
|
+
ROUND(
|
|
220
|
+
CAST((
|
|
221
|
+
(
|
|
222
|
+
(
|
|
223
|
+
`families_with_percent_change`.`num_single_child_families` - `families_with_percent_change`.`last_year_num_single_child_families`
|
|
224
|
+
) / `families_with_percent_change`.`last_year_num_single_child_families`
|
|
225
|
+
) * 100
|
|
226
|
+
) AS FLOAT64),
|
|
227
|
+
2
|
|
228
|
+
)
|
|
229
|
+
) AS `percent change`
|
|
230
|
+
FROM `families_with_percent_change` AS `families_with_percent_change`
|
|
231
|
+
ORDER BY
|
|
232
|
+
ABS(`percent_change`) DESC
|
|
228
233
|
LIMIT 5
|
|
229
234
|
```
|
|
235
|
+
|
|
236
|
+
#### Parameters
|
|
237
|
+
|
|
238
|
+
| Parameter | Description | Default |
|
|
239
|
+
|-------------------|-----------------------------------------------------------------------|------------|
|
|
240
|
+
| `mode` | The mode to use. Can be `cte_only` or `full`. | `cte_only` |
|
|
241
|
+
| `model` | The OpenAI model to use. Note: The default may change in new releases | `gpt-4o` |
|
|
242
|
+
| `prompt_override` | A string to use to override the default prompt. | None |
|