sqlframe 1.11.0__tar.gz → 1.12.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.
Files changed (215) hide show
  1. {sqlframe-1.11.0 → sqlframe-1.12.0}/PKG-INFO +1 -1
  2. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/_version.py +2 -2
  3. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/column.py +41 -0
  4. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/dataframe.py +23 -2
  5. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/function_alternatives.py +5 -7
  6. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/functions.py +4 -2
  7. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/types.py +10 -0
  8. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/functions.py +1 -0
  9. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe.egg-info/PKG-INFO +1 -1
  10. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe.egg-info/SOURCES.txt +1 -0
  11. sqlframe-1.12.0/tests/integration/engines/test_engine_column.py +27 -0
  12. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/test_engine_dataframe.py +25 -19
  13. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/test_int_dataframe.py +10 -0
  14. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_column.py +4 -0
  15. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_dataframe.py +14 -0
  16. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_functions.py +1 -0
  17. {sqlframe-1.11.0 → sqlframe-1.12.0}/.github/CODEOWNERS +0 -0
  18. {sqlframe-1.11.0 → sqlframe-1.12.0}/.github/workflows/main.workflow.yaml +0 -0
  19. {sqlframe-1.11.0 → sqlframe-1.12.0}/.github/workflows/publish.workflow.yaml +0 -0
  20. {sqlframe-1.11.0 → sqlframe-1.12.0}/.gitignore +0 -0
  21. {sqlframe-1.11.0 → sqlframe-1.12.0}/.pre-commit-config.yaml +0 -0
  22. {sqlframe-1.11.0 → sqlframe-1.12.0}/.readthedocs.yaml +0 -0
  23. {sqlframe-1.11.0 → sqlframe-1.12.0}/LICENSE +0 -0
  24. {sqlframe-1.11.0 → sqlframe-1.12.0}/Makefile +0 -0
  25. {sqlframe-1.11.0 → sqlframe-1.12.0}/README.md +0 -0
  26. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/add_chatgpt_support.md +0 -0
  27. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/adding_ai_to_meal.jpeg +0 -0
  28. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/hype_train.gif +0 -0
  29. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/marvin_paranoid_robot.gif +0 -0
  30. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/nonsense_sql.png +0 -0
  31. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/openai_full_rewrite.png +0 -0
  32. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/openai_replacing_cte_names.png +0 -0
  33. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/sqlglot_optimized_code.png +0 -0
  34. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/add_chatgpt_support/sunny_shake_head_no.gif +0 -0
  35. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/but_wait_theres_more.gif +0 -0
  36. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/cake.gif +0 -0
  37. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/images/you_get_pyspark_api.gif +0 -0
  38. {sqlframe-1.11.0 → sqlframe-1.12.0}/blogs/sqlframe_universal_dataframe_api.md +0 -0
  39. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/bigquery.md +0 -0
  40. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/configuration.md +0 -0
  41. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/bigquery.md +0 -0
  42. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/duckdb.md +0 -0
  43. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/images/SF.png +0 -0
  44. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/images/favicon.png +0 -0
  45. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/images/favicon_old.png +0 -0
  46. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/images/sqlframe_diagram.png +0 -0
  47. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/images/sqlframe_logo.png +0 -0
  48. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/docs/postgres.md +0 -0
  49. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/duckdb.md +0 -0
  50. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/images/SF.png +0 -0
  51. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/images/favicon.png +0 -0
  52. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/images/favicon_old.png +0 -0
  53. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/images/sqlframe_diagram.png +0 -0
  54. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/images/sqlframe_logo.png +0 -0
  55. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/index.md +0 -0
  56. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/postgres.md +0 -0
  57. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/requirements.txt +0 -0
  58. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/snowflake.md +0 -0
  59. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/spark.md +0 -0
  60. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/standalone.md +0 -0
  61. {sqlframe-1.11.0 → sqlframe-1.12.0}/docs/stylesheets/extra.css +0 -0
  62. {sqlframe-1.11.0 → sqlframe-1.12.0}/mkdocs.yml +0 -0
  63. {sqlframe-1.11.0 → sqlframe-1.12.0}/pytest.ini +0 -0
  64. {sqlframe-1.11.0 → sqlframe-1.12.0}/renovate.json +0 -0
  65. {sqlframe-1.11.0 → sqlframe-1.12.0}/setup.cfg +0 -0
  66. {sqlframe-1.11.0 → sqlframe-1.12.0}/setup.py +0 -0
  67. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/LICENSE +0 -0
  68. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/__init__.py +0 -0
  69. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/__init__.py +0 -0
  70. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/_typing.py +0 -0
  71. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/catalog.py +0 -0
  72. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/decorators.py +0 -0
  73. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/exceptions.py +0 -0
  74. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/group.py +0 -0
  75. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/mixins/__init__.py +0 -0
  76. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/mixins/catalog_mixins.py +0 -0
  77. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/mixins/dataframe_mixins.py +0 -0
  78. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/mixins/readwriter_mixins.py +0 -0
  79. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/normalize.py +0 -0
  80. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/operations.py +0 -0
  81. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/readerwriter.py +0 -0
  82. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/session.py +0 -0
  83. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/transforms.py +0 -0
  84. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/util.py +0 -0
  85. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/base/window.py +0 -0
  86. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/__init__.py +0 -0
  87. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/catalog.py +0 -0
  88. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/column.py +0 -0
  89. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/dataframe.py +0 -0
  90. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/functions.pyi +0 -0
  91. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/group.py +0 -0
  92. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/readwriter.py +0 -0
  93. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/session.py +0 -0
  94. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/types.py +0 -0
  95. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/bigquery/window.py +0 -0
  96. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/__init__.py +0 -0
  97. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/catalog.py +0 -0
  98. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/column.py +0 -0
  99. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/dataframe.py +0 -0
  100. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/functions.py +0 -0
  101. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/functions.pyi +0 -0
  102. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/group.py +0 -0
  103. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/readwriter.py +0 -0
  104. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/session.py +0 -0
  105. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/types.py +0 -0
  106. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/duckdb/window.py +0 -0
  107. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/__init__.py +0 -0
  108. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/catalog.py +0 -0
  109. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/column.py +0 -0
  110. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/dataframe.py +0 -0
  111. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/functions.py +0 -0
  112. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/functions.pyi +0 -0
  113. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/group.py +0 -0
  114. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/readwriter.py +0 -0
  115. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/session.py +0 -0
  116. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/types.py +0 -0
  117. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/postgres/window.py +0 -0
  118. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/__init__.py +0 -0
  119. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/catalog.py +0 -0
  120. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/column.py +0 -0
  121. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/dataframe.py +0 -0
  122. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/functions.py +0 -0
  123. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/group.py +0 -0
  124. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/readwriter.py +0 -0
  125. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/session.py +0 -0
  126. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/types.py +0 -0
  127. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/redshift/window.py +0 -0
  128. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/__init__.py +0 -0
  129. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/catalog.py +0 -0
  130. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/column.py +0 -0
  131. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/dataframe.py +0 -0
  132. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/functions.py +0 -0
  133. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/functions.pyi +0 -0
  134. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/group.py +0 -0
  135. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/readwriter.py +0 -0
  136. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/session.py +0 -0
  137. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/types.py +0 -0
  138. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/snowflake/window.py +0 -0
  139. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/__init__.py +0 -0
  140. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/catalog.py +0 -0
  141. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/column.py +0 -0
  142. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/dataframe.py +0 -0
  143. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/functions.py +0 -0
  144. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/functions.pyi +0 -0
  145. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/group.py +0 -0
  146. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/readwriter.py +0 -0
  147. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/session.py +0 -0
  148. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/types.py +0 -0
  149. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/spark/window.py +0 -0
  150. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/__init__.py +0 -0
  151. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/catalog.py +0 -0
  152. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/column.py +0 -0
  153. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/dataframe.py +0 -0
  154. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/functions.py +0 -0
  155. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/group.py +0 -0
  156. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/readwriter.py +0 -0
  157. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/session.py +0 -0
  158. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/types.py +0 -0
  159. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/standalone/window.py +0 -0
  160. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/testing/__init__.py +0 -0
  161. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe/testing/utils.py +0 -0
  162. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe.egg-info/dependency_links.txt +0 -0
  163. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe.egg-info/requires.txt +0 -0
  164. {sqlframe-1.11.0 → sqlframe-1.12.0}/sqlframe.egg-info/top_level.txt +0 -0
  165. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/__init__.py +0 -0
  166. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/common_fixtures.py +0 -0
  167. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/conftest.py +0 -0
  168. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/fixtures/employee.csv +0 -0
  169. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/fixtures/employee.json +0 -0
  170. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/fixtures/employee.parquet +0 -0
  171. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/fixtures/employee_extra_line.csv +0 -0
  172. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/__init__.py +0 -0
  173. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/__init__.py +0 -0
  174. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/bigquery/__init__.py +0 -0
  175. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/bigquery/test_bigquery_catalog.py +0 -0
  176. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/bigquery/test_bigquery_dataframe.py +0 -0
  177. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/bigquery/test_bigquery_session.py +0 -0
  178. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/duck/__init__.py +0 -0
  179. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/duck/test_duckdb_catalog.py +0 -0
  180. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/duck/test_duckdb_dataframe.py +0 -0
  181. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/duck/test_duckdb_reader.py +0 -0
  182. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/duck/test_duckdb_session.py +0 -0
  183. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/postgres/__init__.py +0 -0
  184. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/postgres/test_postgres_catalog.py +0 -0
  185. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/postgres/test_postgres_dataframe.py +0 -0
  186. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/postgres/test_postgres_session.py +0 -0
  187. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/redshift/__init__.py +0 -0
  188. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/redshift/test_redshift_catalog.py +0 -0
  189. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/redshift/test_redshift_session.py +0 -0
  190. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/snowflake/__init__.py +0 -0
  191. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/snowflake/test_snowflake_catalog.py +0 -0
  192. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/snowflake/test_snowflake_dataframe.py +0 -0
  193. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/snowflake/test_snowflake_session.py +0 -0
  194. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/spark/__init__.py +0 -0
  195. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/spark/test_spark_catalog.py +0 -0
  196. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/spark/test_spark_dataframe.py +0 -0
  197. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/test_engine_reader.py +0 -0
  198. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/test_engine_session.py +0 -0
  199. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/test_engine_writer.py +0 -0
  200. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/test_int_functions.py +0 -0
  201. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/engines/test_int_testing.py +0 -0
  202. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/fixtures.py +0 -0
  203. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/test_int_dataframe_stats.py +0 -0
  204. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/test_int_grouped_data.py +0 -0
  205. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/integration/test_int_session.py +0 -0
  206. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/types.py +0 -0
  207. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/__init__.py +0 -0
  208. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/__init__.py +0 -0
  209. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/fixtures.py +0 -0
  210. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_dataframe_writer.py +0 -0
  211. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_session.py +0 -0
  212. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_session_case_sensitivity.py +0 -0
  213. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_types.py +0 -0
  214. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/standalone/test_window.py +0 -0
  215. {sqlframe-1.11.0 → sqlframe-1.12.0}/tests/unit/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 1.11.0
3
+ Version: 1.12.0
4
4
  Summary: Turning PySpark Into a Universal DataFrame API
5
5
  Home-page: https://github.com/eakmanrq/sqlframe
6
6
  Author: Ryan Eakman
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.11.0'
16
- __version_tuple__ = version_tuple = (1, 11, 0)
15
+ __version__ = version = '1.12.0'
16
+ __version_tuple__ = version_tuple = (1, 12, 0)
@@ -407,3 +407,44 @@ class Column:
407
407
  window_expression = window.expression.copy()
408
408
  window_expression.set("this", self.column_expression)
409
409
  return Column(window_expression)
410
+
411
+ def getItem(self, key: t.Any) -> Column:
412
+ """
413
+ An expression that gets an item at position ``ordinal`` out of a list,
414
+ or gets an item by key out of a dict.
415
+
416
+ .. versionadded:: 1.3.0
417
+
418
+ .. versionchanged:: 3.4.0
419
+ Supports Spark Connect.
420
+
421
+ Parameters
422
+ ----------
423
+ key
424
+ a literal value, or a :class:`Column` expression.
425
+ The result will only be true at a location if the item matches in the column.
426
+
427
+ .. deprecated:: 3.0.0
428
+ :class:`Column` as a parameter is deprecated.
429
+
430
+ Returns
431
+ -------
432
+ :class:`Column`
433
+ Column representing the item(s) got at position out of a list or by key out of a dict.
434
+
435
+ Examples
436
+ --------
437
+ >>> df = spark.createDataFrame([([1, 2], {"key": "value"})], ["l", "d"])
438
+ >>> df.select(df.l.getItem(0), df.d.getItem("key")).show()
439
+ +----+------+
440
+ |l[0]|d[key]|
441
+ +----+------+
442
+ | 1| value|
443
+ +----+------+
444
+ """
445
+ element_at = get_func_from_session("element_at")
446
+ lit = get_func_from_session("lit")
447
+ key = lit(key) if not isinstance(key, Column) else key
448
+ if isinstance(key.expression, exp.Literal) and key.expression.is_number:
449
+ key = key + lit(1)
450
+ return element_at(self, key)
@@ -361,7 +361,7 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
361
361
 
362
362
  cols = self._ensure_list_of_columns(cols)
363
363
  normalize(self.session, expression or self.expression, cols)
364
- return cols
364
+ return list(flatten([self._expand_star(col) for col in cols]))
365
365
 
366
366
  def _ensure_and_normalize_col(self, col):
367
367
  from sqlframe.base.column import Column
@@ -514,6 +514,27 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
514
514
  select_expressions.append(expression_select_pair) # type: ignore
515
515
  return select_expressions
516
516
 
517
+ def _expand_star(self, col: Column) -> t.List[Column]:
518
+ from sqlframe.base.column import Column
519
+
520
+ if isinstance(col.column_expression, exp.Star):
521
+ return self._get_outer_select_columns(self.expression)
522
+ elif (
523
+ isinstance(col.column_expression, exp.Column)
524
+ and isinstance(col.column_expression.this, exp.Star)
525
+ and col.column_expression.args.get("table")
526
+ ):
527
+ for cte in self.expression.ctes:
528
+ if cte.alias_or_name == col.column_expression.args["table"].this:
529
+ return [
530
+ Column.ensure_col(exp.column(x.column_alias_or_name, cte.alias_or_name))
531
+ for x in self._get_outer_select_columns(cte)
532
+ ]
533
+ raise ValueError(
534
+ f"Could not find table to expand star: {col.column_expression.args['table']}"
535
+ )
536
+ return [col]
537
+
517
538
  @t.overload
518
539
  def sql(
519
540
  self,
@@ -1555,7 +1576,7 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
1555
1576
  result = self.session._fetch_rows(sql)
1556
1577
  table = PrettyTable()
1557
1578
  if row := seq_get(result, 0):
1558
- table.field_names = list(row.asDict().keys())
1579
+ table.field_names = row._unique_field_names
1559
1580
  for row in result:
1560
1581
  table.add_row(list(row))
1561
1582
  print(table)
@@ -1135,13 +1135,11 @@ def array_intersect_using_intersection(col1: ColumnOrName, col2: ColumnOrName) -
1135
1135
  def element_at_using_brackets(col: ColumnOrName, value: ColumnOrLiteral) -> Column:
1136
1136
  col_func = get_func_from_session("col")
1137
1137
  lit = get_func_from_session("lit")
1138
- # SQLGlot will auto add 1 to whatever we pass in for the brackets even though the value is already 1 based.
1139
- if not isinstance(value, int):
1140
- raise ValueError("This dialect requires the value must be an integer")
1141
- value_lit = lit(value - 1)
1142
- return Column(
1143
- expression.Bracket(this=col_func(col).expression, expressions=[value_lit.expression])
1144
- )
1138
+ # SQLGlot will auto add 1 to whatever we pass in for the brackets even though the value is already 1 based.
1139
+ value = value if isinstance(value, Column) else lit(value)
1140
+ if [x for x in value.expression.find_all(expression.Literal) if x.is_number]:
1141
+ value = value - lit(1)
1142
+ return Column(expression.Bracket(this=col_func(col).expression, expressions=[value.expression])) # type: ignore
1145
1143
 
1146
1144
 
1147
1145
  def array_remove_using_filter(col: ColumnOrName, value: ColumnOrLiteral) -> Column:
@@ -1923,7 +1923,9 @@ def call_function(funcName: str, *cols: ColumnOrName) -> Column:
1923
1923
  cols = ensure_list(cols) # type: ignore
1924
1924
  if len(cols) > 1:
1925
1925
  return Column.invoke_anonymous_function(cols[0], funcName, *cols[1:])
1926
- return Column.invoke_anonymous_function(cols[0], funcName)
1926
+ elif len(cols) == 1:
1927
+ return Column.invoke_anonymous_function(cols[0], funcName)
1928
+ return Column.invoke_anonymous_function(None, funcName)
1927
1929
 
1928
1930
 
1929
1931
  # @meta(unsupported_engines="*")
@@ -2028,7 +2030,7 @@ def character_length(str: ColumnOrName) -> Column:
2028
2030
  return Column.invoke_anonymous_function(str, "character_length")
2029
2031
 
2030
2032
 
2031
- @meta(unsupported_engines="*")
2033
+ @meta()
2032
2034
  def contains(left: ColumnOrName, right: ColumnOrName) -> Column:
2033
2035
  return Column.invoke_anonymous_function(left, "contains", right)
2034
2036
 
@@ -416,3 +416,13 @@ class Row(tuple):
416
416
  )
417
417
  else:
418
418
  return "<Row(%s)>" % ", ".join(repr(field) for field in self)
419
+
420
+ # SQLFrame Specific
421
+ @property
422
+ def _unique_field_names(self) -> t.List[str]:
423
+ fields = []
424
+ for i, field in enumerate(self.__fields__):
425
+ if field in fields:
426
+ field = field + "_" + str(i)
427
+ fields.append(field)
428
+ return fields
@@ -52,6 +52,7 @@ from sqlframe.base.function_alternatives import ( # noqa
52
52
  make_date_from_date_func as make_date,
53
53
  to_date_from_timestamp as to_date,
54
54
  last_day_with_cast as last_day,
55
+ sha1_force_sha1_and_to_hex as sha,
55
56
  sha1_force_sha1_and_to_hex as sha1,
56
57
  hash_from_farm_fingerprint as hash,
57
58
  base64_from_blob as base64,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 1.11.0
3
+ Version: 1.12.0
4
4
  Summary: Turning PySpark Into a Universal DataFrame API
5
5
  Home-page: https://github.com/eakmanrq/sqlframe
6
6
  Author: Ryan Eakman
@@ -170,6 +170,7 @@ tests/integration/test_int_dataframe_stats.py
170
170
  tests/integration/test_int_grouped_data.py
171
171
  tests/integration/test_int_session.py
172
172
  tests/integration/engines/__init__.py
173
+ tests/integration/engines/test_engine_column.py
173
174
  tests/integration/engines/test_engine_dataframe.py
174
175
  tests/integration/engines/test_engine_reader.py
175
176
  tests/integration/engines/test_engine_session.py
@@ -0,0 +1,27 @@
1
+ from __future__ import annotations
2
+
3
+ import typing as t
4
+
5
+ import pytest
6
+
7
+ from sqlframe.base import types
8
+ from sqlframe.bigquery import BigQuerySession
9
+ from sqlframe.postgres import PostgresSession
10
+
11
+ if t.TYPE_CHECKING:
12
+ from sqlframe.base.session import _BaseSession
13
+
14
+ pytest_plugins = ["tests.integration.fixtures"]
15
+
16
+
17
+ def test_column_get_item_array(get_session: t.Callable[[], _BaseSession], get_func):
18
+ session = get_session()
19
+ lit = get_func("lit", session)
20
+ assert session.range(1).select(lit(["a", "b", "c"]).getItem(0).alias("value")).first()[0] == "a"
21
+
22
+
23
+ def test_column_get_item_map(get_session: t.Callable[[], _BaseSession], get_func):
24
+ session = get_session()
25
+ lit = get_func("lit", session)
26
+ if not isinstance(session, (PostgresSession, BigQuerySession)):
27
+ assert session.range(1).select(lit({"key": "value"}).getItem("key")).first()[0] == "value"
@@ -24,36 +24,42 @@ def test_collect(get_engine_df: t.Callable[[str], _BaseDataFrame], get_func):
24
24
 
25
25
 
26
26
  def test_show(
27
- get_engine_df: t.Callable[[str], _BaseDataFrame], capsys, caplog, is_snowflake: t.Callable
27
+ get_engine_df: t.Callable[[str], _BaseDataFrame],
28
+ get_func,
29
+ capsys,
30
+ caplog,
31
+ is_snowflake: t.Callable,
28
32
  ):
29
33
  employee = get_engine_df("employee")
34
+ lit = get_func("lit", employee.session)
35
+ employee = employee.select("*", lit(1).alias("one"))
30
36
  employee.show()
31
37
  captured = capsys.readouterr()
32
38
  if is_snowflake():
33
39
  assert (
34
40
  captured.out
35
- == """+-------------+--------+-----------+-----+----------+
36
- | EMPLOYEE_ID | FNAME | LNAME | AGE | STORE_ID |
37
- +-------------+--------+-----------+-----+----------+
38
- | 1 | Jack | Shephard | 37 | 1 |
39
- | 2 | John | Locke | 65 | 1 |
40
- | 3 | Kate | Austen | 37 | 2 |
41
- | 4 | Claire | Littleton | 27 | 2 |
42
- | 5 | Hugo | Reyes | 29 | 100 |
43
- +-------------+--------+-----------+-----+----------+\n"""
41
+ == """+-------------+--------+-----------+-----+----------+-----+
42
+ | EMPLOYEE_ID | FNAME | LNAME | AGE | STORE_ID | ONE |
43
+ +-------------+--------+-----------+-----+----------+-----+
44
+ | 1 | Jack | Shephard | 37 | 1 | 1 |
45
+ | 2 | John | Locke | 65 | 1 | 1 |
46
+ | 3 | Kate | Austen | 37 | 2 | 1 |
47
+ | 4 | Claire | Littleton | 27 | 2 | 1 |
48
+ | 5 | Hugo | Reyes | 29 | 100 | 1 |
49
+ +-------------+--------+-----------+-----+----------+-----+\n"""
44
50
  )
45
51
  else:
46
52
  assert (
47
53
  captured.out
48
- == """+-------------+--------+-----------+-----+----------+
49
- | employee_id | fname | lname | age | store_id |
50
- +-------------+--------+-----------+-----+----------+
51
- | 1 | Jack | Shephard | 37 | 1 |
52
- | 2 | John | Locke | 65 | 1 |
53
- | 3 | Kate | Austen | 37 | 2 |
54
- | 4 | Claire | Littleton | 27 | 2 |
55
- | 5 | Hugo | Reyes | 29 | 100 |
56
- +-------------+--------+-----------+-----+----------+\n"""
54
+ == """+-------------+--------+-----------+-----+----------+-----+
55
+ | employee_id | fname | lname | age | store_id | one |
56
+ +-------------+--------+-----------+-----+----------+-----+
57
+ | 1 | Jack | Shephard | 37 | 1 | 1 |
58
+ | 2 | John | Locke | 65 | 1 | 1 |
59
+ | 3 | Kate | Austen | 37 | 2 | 1 |
60
+ | 4 | Claire | Littleton | 27 | 2 | 1 |
61
+ | 5 | Hugo | Reyes | 29 | 100 | 1 |
62
+ +-------------+--------+-----------+-----+----------+-----+\n"""
57
63
  )
58
64
  assert "Truncate is ignored so full results will be displayed" not in caplog.text
59
65
  employee.show(truncate=True)
@@ -51,6 +51,16 @@ def test_simple_select_from_table(
51
51
  compare_frames(df, dfs)
52
52
 
53
53
 
54
+ def test_select_star_from_table(
55
+ pyspark_employee: PySparkDataFrame,
56
+ get_df: t.Callable[[str], _BaseDataFrame],
57
+ compare_frames: t.Callable,
58
+ ):
59
+ df = pyspark_employee
60
+ dfs = get_df("employee").session.read.table("employee")
61
+ compare_frames(df, dfs)
62
+
63
+
54
64
  def test_simple_select_df_attribute(
55
65
  pyspark_employee: PySparkDataFrame,
56
66
  get_df: t.Callable[[str], _BaseDataFrame],
@@ -220,3 +220,7 @@ def test_over():
220
220
  ).sql()
221
221
  == "SUM(cola) OVER (PARTITION BY colb ORDER BY colc RANGE BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING)"
222
222
  )
223
+
224
+
225
+ def test_get_item():
226
+ assert F.col("cola").getItem(1).sql() == "ELEMENT_AT(cola, (1 + 1))"
@@ -123,3 +123,17 @@ def test_missing_method(standalone_employee: StandaloneDataFrame):
123
123
  UnsupportedOperationError, match="Tried to call a column which is unexpected.*"
124
124
  ):
125
125
  standalone_employee.missing_method("blah")
126
+
127
+
128
+ def test_expand_star(standalone_employee: StandaloneDataFrame):
129
+ assert (
130
+ standalone_employee.select("*").sql(pretty=False, optimize=False)
131
+ == "WITH t51718876 AS (SELECT CAST(employee_id AS INT) AS employee_id, CAST(fname AS STRING) AS fname, CAST(lname AS STRING) AS lname, CAST(age AS INT) AS age, CAST(store_id AS INT) AS store_id FROM VALUES (1, 'Jack', 'Shephard', 37, 1), (2, 'John', 'Locke', 65, 1), (3, 'Kate', 'Austen', 37, 2), (4, 'Claire', 'Littleton', 27, 2), (5, 'Hugo', 'Reyes', 29, 100) AS a1(employee_id, fname, lname, age, store_id)) SELECT employee_id, fname, lname, age, store_id FROM t51718876"
132
+ )
133
+
134
+
135
+ def test_expand_star_table_alias(standalone_employee: StandaloneDataFrame):
136
+ assert (
137
+ standalone_employee.alias("blah").select("blah.*").sql(pretty=False, optimize=False)
138
+ == "WITH t51718876 AS (SELECT CAST(employee_id AS INT) AS employee_id, CAST(fname AS STRING) AS fname, CAST(lname AS STRING) AS lname, CAST(age AS INT) AS age, CAST(store_id AS INT) AS store_id FROM VALUES (1, 'Jack', 'Shephard', 37, 1), (2, 'John', 'Locke', 65, 1), (3, 'Kate', 'Austen', 37, 2), (4, 'Claire', 'Littleton', 27, 2), (5, 'Hugo', 'Reyes', 29, 100) AS a1(employee_id, fname, lname, age, store_id)), t37842204 AS (SELECT employee_id, fname, lname, age, store_id FROM t51718876) SELECT t37842204.employee_id, t37842204.fname, t37842204.lname, t37842204.age, t37842204.store_id FROM t37842204"
139
+ )
@@ -3244,6 +3244,7 @@ def test_bucket(expression, expected):
3244
3244
  (SF.call_function("blah", "cola"), "BLAH(cola)"),
3245
3245
  (SF.call_function("blah", SF.col("cola")), "BLAH(cola)"),
3246
3246
  (SF.call_function("blah", "cola", "colb"), "BLAH(cola, colb)"),
3247
+ (SF.call_function("blah"), "BLAH()"),
3247
3248
  ],
3248
3249
  )
3249
3250
  def test_call_function(expression, expected):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes