sqlframe 3.2.0__tar.gz → 3.3.1__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 (355) hide show
  1. {sqlframe-3.2.0 → sqlframe-3.3.1}/PKG-INFO +1 -1
  2. {sqlframe-3.2.0 → sqlframe-3.3.1}/setup.py +5 -5
  3. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/_version.py +2 -2
  4. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/dataframe.py +5 -1
  5. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/functions.py +2 -2
  6. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/session.py +5 -1
  7. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/util.py +1 -1
  8. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/readwriter.py +2 -0
  9. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/session.py +8 -2
  10. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/catalog.py +3 -1
  11. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe.egg-info/PKG-INFO +1 -1
  12. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe.egg-info/SOURCES.txt +100 -0
  13. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe.egg-info/requires.txt +5 -5
  14. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/common_fixtures.py +55 -6
  15. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds1.sql +23 -0
  16. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds10.sql +65 -0
  17. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds11.sql +80 -0
  18. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds12.sql +27 -0
  19. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds13.sql +41 -0
  20. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds14.sql +134 -0
  21. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds15.sql +27 -0
  22. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds16.sql +24 -0
  23. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds17.sql +47 -0
  24. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds18.sql +49 -0
  25. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds19.sql +30 -0
  26. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds2.sql +79 -0
  27. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds20.sql +27 -0
  28. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds21.sql +30 -0
  29. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds22.sql +18 -0
  30. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds23.sql +84 -0
  31. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds24.sql +52 -0
  32. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds25.sql +40 -0
  33. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds26.sql +23 -0
  34. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds27.sql +60 -0
  35. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds28.sql +51 -0
  36. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds29.sql +41 -0
  37. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds3.sql +18 -0
  38. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds30.sql +49 -0
  39. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds31.sql +70 -0
  40. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds32.sql +16 -0
  41. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds33.sql +66 -0
  42. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds34.sql +40 -0
  43. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds35.sql +60 -0
  44. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds36.sql +58 -0
  45. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds37.sql +22 -0
  46. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds38.sql +28 -0
  47. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds39.sql +58 -0
  48. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds4.sql +119 -0
  49. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds40.sql +25 -0
  50. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds41.sql +66 -0
  51. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds42.sql +19 -0
  52. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds43.sql +49 -0
  53. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds44.sql +47 -0
  54. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds45.sql +41 -0
  55. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds46.sql +46 -0
  56. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds47.sql +71 -0
  57. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds48.sql +39 -0
  58. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds49.sql +101 -0
  59. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds5.sql +112 -0
  60. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds50.sql +67 -0
  61. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds51.sql +52 -0
  62. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds52.sql +19 -0
  63. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds53.sql +47 -0
  64. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds54.sql +57 -0
  65. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds55.sql +16 -0
  66. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds56.sql +73 -0
  67. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds57.sql +64 -0
  68. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds58.sql +70 -0
  69. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds59.sql +85 -0
  70. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds6.sql +25 -0
  71. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds60.sql +67 -0
  72. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds61.sql +46 -0
  73. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds62.sql +45 -0
  74. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds63.sql +47 -0
  75. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds64.sql +124 -0
  76. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds65.sql +37 -0
  77. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds66.sql +217 -0
  78. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds67.sql +44 -0
  79. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds68.sql +44 -0
  80. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds69.sql +51 -0
  81. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds7.sql +23 -0
  82. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds70.sql +36 -0
  83. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds71.sql +46 -0
  84. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds72.sql +38 -0
  85. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds73.sql +39 -0
  86. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds74.sql +64 -0
  87. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds75.sql +75 -0
  88. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds76.sql +55 -0
  89. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds77.sql +95 -0
  90. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds78.sql +76 -0
  91. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds79.sql +38 -0
  92. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds8.sql +427 -0
  93. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds80.sql +86 -0
  94. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds81.sql +55 -0
  95. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds82.sql +22 -0
  96. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds83.sql +70 -0
  97. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds84.sql +18 -0
  98. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds85.sql +57 -0
  99. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds86.sql +22 -0
  100. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds87.sql +30 -0
  101. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds88.sql +138 -0
  102. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds89.sql +19 -0
  103. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds9.sql +67 -0
  104. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds90.sql +26 -0
  105. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds91.sql +30 -0
  106. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds92.sql +17 -0
  107. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds93.sql +19 -0
  108. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds94.sql +24 -0
  109. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds95.sql +31 -0
  110. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds96.sql +14 -0
  111. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds97.sql +34 -0
  112. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds98.sql +26 -0
  113. sqlframe-3.3.1/tests/fixtures/tpcds/tpcds99.sql +44 -0
  114. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/duck/test_duckdb_catalog.py +1 -2
  115. sqlframe-3.3.1/tests/integration/engines/duck/test_tpcds.py +32 -0
  116. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/spark/test_spark_catalog.py +13 -4
  117. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/test_int_functions.py +11 -7
  118. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/fixtures.py +4 -1
  119. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_functions.py +8 -4
  120. {sqlframe-3.2.0 → sqlframe-3.3.1}/.github/CODEOWNERS +0 -0
  121. {sqlframe-3.2.0 → sqlframe-3.3.1}/.github/workflows/main.workflow.yaml +0 -0
  122. {sqlframe-3.2.0 → sqlframe-3.3.1}/.github/workflows/publish.workflow.yaml +0 -0
  123. {sqlframe-3.2.0 → sqlframe-3.3.1}/.gitignore +0 -0
  124. {sqlframe-3.2.0 → sqlframe-3.3.1}/.pre-commit-config.yaml +0 -0
  125. {sqlframe-3.2.0 → sqlframe-3.3.1}/.readthedocs.yaml +0 -0
  126. {sqlframe-3.2.0 → sqlframe-3.3.1}/LICENSE +0 -0
  127. {sqlframe-3.2.0 → sqlframe-3.3.1}/Makefile +0 -0
  128. {sqlframe-3.2.0 → sqlframe-3.3.1}/README.md +0 -0
  129. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/add_chatgpt_support.md +0 -0
  130. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/adding_ai_to_meal.jpeg +0 -0
  131. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/hype_train.gif +0 -0
  132. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/marvin_paranoid_robot.gif +0 -0
  133. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/nonsense_sql.png +0 -0
  134. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/openai_full_rewrite.png +0 -0
  135. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/openai_replacing_cte_names.png +0 -0
  136. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/sqlglot_optimized_code.png +0 -0
  137. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/add_chatgpt_support/sunny_shake_head_no.gif +0 -0
  138. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/but_wait_theres_more.gif +0 -0
  139. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/cake.gif +0 -0
  140. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/images/you_get_pyspark_api.gif +0 -0
  141. {sqlframe-3.2.0 → sqlframe-3.3.1}/blogs/sqlframe_universal_dataframe_api.md +0 -0
  142. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/bigquery.md +0 -0
  143. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/configuration.md +0 -0
  144. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/bigquery.md +0 -0
  145. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/duckdb.md +0 -0
  146. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/images/SF.png +0 -0
  147. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/images/favicon.png +0 -0
  148. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/images/favicon_old.png +0 -0
  149. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/images/sqlframe_diagram.png +0 -0
  150. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/images/sqlframe_logo.png +0 -0
  151. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/docs/postgres.md +0 -0
  152. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/duckdb.md +0 -0
  153. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/images/SF.png +0 -0
  154. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/images/favicon.png +0 -0
  155. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/images/favicon_old.png +0 -0
  156. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/images/sqlframe_diagram.png +0 -0
  157. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/images/sqlframe_logo.png +0 -0
  158. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/index.md +0 -0
  159. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/postgres.md +0 -0
  160. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/requirements.txt +0 -0
  161. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/snowflake.md +0 -0
  162. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/spark.md +0 -0
  163. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/standalone.md +0 -0
  164. {sqlframe-3.2.0 → sqlframe-3.3.1}/docs/stylesheets/extra.css +0 -0
  165. {sqlframe-3.2.0 → sqlframe-3.3.1}/mkdocs.yml +0 -0
  166. {sqlframe-3.2.0 → sqlframe-3.3.1}/pytest.ini +0 -0
  167. {sqlframe-3.2.0 → sqlframe-3.3.1}/renovate.json +0 -0
  168. {sqlframe-3.2.0 → sqlframe-3.3.1}/setup.cfg +0 -0
  169. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/LICENSE +0 -0
  170. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/__init__.py +0 -0
  171. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/__init__.py +0 -0
  172. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/_typing.py +0 -0
  173. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/catalog.py +0 -0
  174. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/column.py +0 -0
  175. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/decorators.py +0 -0
  176. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/exceptions.py +0 -0
  177. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/function_alternatives.py +0 -0
  178. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/group.py +0 -0
  179. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/mixins/__init__.py +0 -0
  180. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/mixins/catalog_mixins.py +0 -0
  181. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/mixins/dataframe_mixins.py +0 -0
  182. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/mixins/readwriter_mixins.py +0 -0
  183. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/normalize.py +0 -0
  184. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/operations.py +0 -0
  185. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/readerwriter.py +0 -0
  186. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/transforms.py +0 -0
  187. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/types.py +0 -0
  188. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/udf.py +0 -0
  189. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/base/window.py +0 -0
  190. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/__init__.py +0 -0
  191. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/catalog.py +0 -0
  192. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/column.py +0 -0
  193. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/dataframe.py +0 -0
  194. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/functions.py +0 -0
  195. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/functions.pyi +0 -0
  196. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/group.py +0 -0
  197. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/readwriter.py +0 -0
  198. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/session.py +0 -0
  199. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/types.py +0 -0
  200. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/udf.py +0 -0
  201. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/bigquery/window.py +0 -0
  202. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/__init__.py +0 -0
  203. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/catalog.py +0 -0
  204. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/column.py +0 -0
  205. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/dataframe.py +0 -0
  206. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/functions.py +0 -0
  207. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/functions.pyi +0 -0
  208. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/group.py +0 -0
  209. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/types.py +0 -0
  210. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/udf.py +0 -0
  211. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/duckdb/window.py +0 -0
  212. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/__init__.py +0 -0
  213. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/catalog.py +0 -0
  214. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/column.py +0 -0
  215. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/dataframe.py +0 -0
  216. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/functions.py +0 -0
  217. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/functions.pyi +0 -0
  218. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/group.py +0 -0
  219. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/readwriter.py +0 -0
  220. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/session.py +0 -0
  221. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/types.py +0 -0
  222. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/udf.py +0 -0
  223. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/postgres/window.py +0 -0
  224. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/__init__.py +0 -0
  225. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/catalog.py +0 -0
  226. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/column.py +0 -0
  227. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/dataframe.py +0 -0
  228. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/functions.py +0 -0
  229. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/group.py +0 -0
  230. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/readwriter.py +0 -0
  231. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/session.py +0 -0
  232. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/types.py +0 -0
  233. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/udf.py +0 -0
  234. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/redshift/window.py +0 -0
  235. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/__init__.py +0 -0
  236. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/catalog.py +0 -0
  237. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/column.py +0 -0
  238. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/dataframe.py +0 -0
  239. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/functions.py +0 -0
  240. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/functions.pyi +0 -0
  241. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/group.py +0 -0
  242. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/readwriter.py +0 -0
  243. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/session.py +0 -0
  244. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/types.py +0 -0
  245. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/udf.py +0 -0
  246. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/snowflake/window.py +0 -0
  247. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/__init__.py +0 -0
  248. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/column.py +0 -0
  249. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/dataframe.py +0 -0
  250. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/functions.py +0 -0
  251. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/functions.pyi +0 -0
  252. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/group.py +0 -0
  253. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/readwriter.py +0 -0
  254. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/session.py +0 -0
  255. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/types.py +0 -0
  256. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/udf.py +0 -0
  257. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/spark/window.py +0 -0
  258. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/__init__.py +0 -0
  259. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/catalog.py +0 -0
  260. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/column.py +0 -0
  261. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/dataframe.py +0 -0
  262. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/functions.py +0 -0
  263. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/group.py +0 -0
  264. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/readwriter.py +0 -0
  265. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/session.py +0 -0
  266. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/types.py +0 -0
  267. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/udf.py +0 -0
  268. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/standalone/window.py +0 -0
  269. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/testing/__init__.py +0 -0
  270. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe/testing/utils.py +0 -0
  271. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe.egg-info/dependency_links.txt +0 -0
  272. {sqlframe-3.2.0 → sqlframe-3.3.1}/sqlframe.egg-info/top_level.txt +0 -0
  273. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/__init__.py +0 -0
  274. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/conftest.py +0 -0
  275. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee.csv +0 -0
  276. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee.json +0 -0
  277. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee.parquet +0 -0
  278. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/.part-00000-e5965c7b-e58f-4d3c-ad56-002876814e3a-c000.snappy.parquet.crc +0 -0
  279. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/.part-00002-3fed7f18-370f-4b16-b232-504d6194eb52-c000.snappy.parquet.crc +0 -0
  280. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/.part-00004-143c5da1-d5ab-4706-8e84-0d2a324c6894-c000.snappy.parquet.crc +0 -0
  281. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/.part-00006-64f07e25-c30e-4075-acc6-b3c69c4ce80b-c000.snappy.parquet.crc +0 -0
  282. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/.part-00008-89ccad8d-df73-4ad5-8850-82ef3884db60-c000.snappy.parquet.crc +0 -0
  283. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/.part-00010-812b3382-8c7f-4c4e-9bcd-09ce8664f6e0-c000.snappy.parquet.crc +0 -0
  284. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/_delta_log/.00000000000000000000.json.crc +0 -0
  285. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/_delta_log/00000000000000000000.json +0 -0
  286. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/part-00000-e5965c7b-e58f-4d3c-ad56-002876814e3a-c000.snappy.parquet +0 -0
  287. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/part-00002-3fed7f18-370f-4b16-b232-504d6194eb52-c000.snappy.parquet +0 -0
  288. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/part-00004-143c5da1-d5ab-4706-8e84-0d2a324c6894-c000.snappy.parquet +0 -0
  289. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/part-00006-64f07e25-c30e-4075-acc6-b3c69c4ce80b-c000.snappy.parquet +0 -0
  290. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/part-00008-89ccad8d-df73-4ad5-8850-82ef3884db60-c000.snappy.parquet +0 -0
  291. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_delta/part-00010-812b3382-8c7f-4c4e-9bcd-09ce8664f6e0-c000.snappy.parquet +0 -0
  292. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/fixtures/employee_extra_line.csv +0 -0
  293. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/__init__.py +0 -0
  294. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/__init__.py +0 -0
  295. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/bigquery/__init__.py +0 -0
  296. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/bigquery/test_bigquery_catalog.py +0 -0
  297. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/bigquery/test_bigquery_dataframe.py +0 -0
  298. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/bigquery/test_bigquery_session.py +0 -0
  299. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/duck/__init__.py +0 -0
  300. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/duck/test_duckdb_activate.py +0 -0
  301. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/duck/test_duckdb_dataframe.py +0 -0
  302. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/duck/test_duckdb_reader.py +0 -0
  303. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/duck/test_duckdb_session.py +0 -0
  304. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/duck/test_duckdb_udf.py +0 -0
  305. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/postgres/__init__.py +0 -0
  306. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/postgres/test_postgres_activate.py +0 -0
  307. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/postgres/test_postgres_catalog.py +0 -0
  308. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/postgres/test_postgres_dataframe.py +0 -0
  309. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/postgres/test_postgres_session.py +0 -0
  310. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/redshift/__init__.py +0 -0
  311. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/redshift/test_redshift_catalog.py +0 -0
  312. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/redshift/test_redshift_session.py +0 -0
  313. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/snowflake/__init__.py +0 -0
  314. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/snowflake/test_snowflake_catalog.py +0 -0
  315. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/snowflake/test_snowflake_dataframe.py +0 -0
  316. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/snowflake/test_snowflake_session.py +0 -0
  317. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/spark/__init__.py +0 -0
  318. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/spark/test_spark_dataframe.py +0 -0
  319. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/test_engine_column.py +0 -0
  320. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/test_engine_dataframe.py +0 -0
  321. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/test_engine_reader.py +0 -0
  322. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/test_engine_session.py +0 -0
  323. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/test_engine_writer.py +0 -0
  324. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/engines/test_int_testing.py +0 -0
  325. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/test_int_dataframe.py +0 -0
  326. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/test_int_dataframe_stats.py +0 -0
  327. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/test_int_grouped_data.py +0 -0
  328. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/integration/test_int_session.py +0 -0
  329. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/types.py +0 -0
  330. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/__init__.py +0 -0
  331. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/bigquery/__init__.py +0 -0
  332. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/bigquery/test_activate.py +0 -0
  333. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/conftest.py +0 -0
  334. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/duck/__init__.py +0 -0
  335. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/duck/test_activate.py +0 -0
  336. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/postgres/__init__.py +0 -0
  337. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/postgres/test_activate.py +0 -0
  338. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/redshift/__init__.py +0 -0
  339. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/redshift/test_activate.py +0 -0
  340. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/snowflake/__init__.py +0 -0
  341. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/snowflake/test_activate.py +0 -0
  342. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/spark/__init__.py +0 -0
  343. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/spark/test_activate.py +0 -0
  344. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/__init__.py +0 -0
  345. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/fixtures.py +0 -0
  346. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_activate.py +0 -0
  347. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_column.py +0 -0
  348. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_dataframe.py +0 -0
  349. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_dataframe_writer.py +0 -0
  350. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_session.py +0 -0
  351. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_session_case_sensitivity.py +0 -0
  352. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_types.py +0 -0
  353. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/standalone/test_window.py +0 -0
  354. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/test_activate.py +0 -0
  355. {sqlframe-3.2.0 → sqlframe-3.3.1}/tests/unit/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 3.2.0
3
+ Version: 3.3.1
4
4
  Summary: Turning PySpark Into a Universal DataFrame API
5
5
  Home-page: https://github.com/eakmanrq/sqlframe
6
6
  Author: Ryan Eakman
@@ -20,7 +20,7 @@ setup(
20
20
  python_requires=">=3.8",
21
21
  install_requires=[
22
22
  "prettytable<3.11.1",
23
- "sqlglot>=24.0.0,<25.19",
23
+ "sqlglot>=24.0.0,<25.23",
24
24
  "typing_extensions>=4.8,<5",
25
25
  ],
26
26
  extras_require={
@@ -29,10 +29,10 @@ setup(
29
29
  "google-cloud-bigquery-storage>=2,<3",
30
30
  ],
31
31
  "dev": [
32
- "duckdb>=0.9,<1.1",
32
+ "duckdb>=0.9,<1.2",
33
33
  "findspark>=2,<3",
34
34
  "mypy>=1.10.0,<1.12",
35
- "openai>=1.30,<1.44",
35
+ "openai>=1.30,<1.48",
36
36
  "pandas>=2,<3",
37
37
  "pandas-stubs>=2,<3",
38
38
  "psycopg>=3.1,<4",
@@ -54,11 +54,11 @@ setup(
54
54
  "pymdown-extensions",
55
55
  ],
56
56
  "duckdb": [
57
- "duckdb>=0.9,<1.1",
57
+ "duckdb>=0.9,<1.2",
58
58
  "pandas>=2,<3",
59
59
  ],
60
60
  "openai": [
61
- "openai>=1.30,<1.44",
61
+ "openai>=1.30,<1.48",
62
62
  ],
63
63
  "pandas": [
64
64
  "pandas>=2,<3",
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '3.2.0'
16
- __version_tuple__ = version_tuple = (3, 2, 0)
15
+ __version__ = version = '3.3.1'
16
+ __version_tuple__ = version_tuple = (3, 3, 1)
@@ -1627,7 +1627,11 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
1627
1627
 
1628
1628
  def createOrReplaceTempView(self, name: str) -> None:
1629
1629
  name = normalize_string(name, from_dialect="input")
1630
- self.session.temp_views[name] = self.copy()._convert_leaf_to_cte()
1630
+ df = self.copy()._convert_leaf_to_cte()
1631
+ self.session.temp_views[name] = df
1632
+ self.session.catalog.add_table(
1633
+ name, [x.alias_or_name for x in self._get_outer_select_columns(df.expression)]
1634
+ )
1631
1635
 
1632
1636
  def count(self) -> int:
1633
1637
  if not self.session._has_connection:
@@ -2052,7 +2052,7 @@ def cardinality(col: ColumnOrName) -> Column:
2052
2052
 
2053
2053
  @meta()
2054
2054
  def char(col: ColumnOrName) -> Column:
2055
- return Column.invoke_expression_over_column(col, expression.Chr)
2055
+ return Column(expression.Chr(expressions=Column.ensure_col(col).expression))
2056
2056
 
2057
2057
 
2058
2058
  @meta(unsupported_engines="*")
@@ -2703,7 +2703,7 @@ def inline(col: ColumnOrName) -> Column:
2703
2703
  | 3| 4|
2704
2704
  +---+---+
2705
2705
  """
2706
- return Column.invoke_anonymous_function(col, "inline")
2706
+ return Column.invoke_expression_over_column(col, expression.Inline)
2707
2707
 
2708
2708
 
2709
2709
  @meta(unsupported_engines="*")
@@ -391,7 +391,11 @@ class _BaseSession(t.Generic[CATALOG, READER, WRITER, DF, CONN, UDF_REGISTRATION
391
391
  )
392
392
  if qualify:
393
393
  expression = qualify_func(
394
- expression, dialect=dialect, quote_identifiers=False, identify=False
394
+ expression,
395
+ dialect=dialect,
396
+ quote_identifiers=False,
397
+ identify=False,
398
+ schema=self.catalog._schema,
395
399
  )
396
400
  if self.temp_views:
397
401
  replacement_mapping = {}
@@ -306,7 +306,6 @@ def quote_preserving_alias_or_name(col: t.Union[exp.Column, exp.Alias]) -> str:
306
306
  def sqlglot_to_spark(sqlglot_dtype: exp.DataType) -> types.DataType:
307
307
  from sqlframe.base import types
308
308
 
309
- sqlglot_to_spark
310
309
  primitive_mapping = {
311
310
  exp.DataType.Type.VARCHAR: types.VarcharType,
312
311
  exp.DataType.Type.CHAR: types.CharType,
@@ -325,6 +324,7 @@ def sqlglot_to_spark(sqlglot_dtype: exp.DataType) -> types.DataType:
325
324
  exp.DataType.Type.TIMESTAMPLTZ: types.TimestampType,
326
325
  exp.DataType.Type.TIMESTAMPNTZ: types.TimestampType,
327
326
  exp.DataType.Type.DATE: types.DateType,
327
+ exp.DataType.Type.JSON: types.StringType,
328
328
  }
329
329
  if sqlglot_dtype.this in primitive_mapping:
330
330
  pyspark_class = primitive_mapping[sqlglot_dtype.this]
@@ -93,6 +93,8 @@ class DuckDBDataFrameReader(_BaseDataFrameReader["DuckDBSession", "DuckDBDataFra
93
93
  else:
94
94
  from_clause = f"'{path}'"
95
95
  df = self.session.sql(exp.select(*select_columns).from_(from_clause), qualify=False)
96
+ if select_columns == [exp.Star()]:
97
+ return self.load(path=path, format=format, schema=df.schema, **options)
96
98
  self.session._last_loaded_file = path # type: ignore
97
99
  return df
98
100
 
@@ -54,8 +54,14 @@ class DuckDBSession(
54
54
 
55
55
  @classmethod
56
56
  def _try_get_map(cls, value: t.Any) -> t.Optional[t.Dict[str, t.Any]]:
57
- if value and isinstance(value, dict) and "key" in value and "value" in value:
58
- return dict(zip(value["key"], value["value"]))
57
+ if value and isinstance(value, dict):
58
+ # DuckDB < 1.1.0 support
59
+ if "key" in value and "value" in value:
60
+ return dict(zip(value["key"], value["value"]))
61
+ # DuckDB >= 1.1.0 support
62
+ # If a key is not a string then it must not represent a column and therefore must be a map
63
+ if len([k for k in value if not isinstance(k, str)]) > 0:
64
+ return value
59
65
  return None
60
66
 
61
67
  def _execute(self, sql: str) -> None:
@@ -569,7 +569,9 @@ class SparkCatalog(
569
569
  return [
570
570
  Table(
571
571
  name=normalize_string(x.name, from_dialect="execution", to_dialect="output"),
572
- catalog=normalize_string(x.catalog, from_dialect="execution", to_dialect="output"),
572
+ catalog=normalize_string(x.catalog, from_dialect="execution", to_dialect="output")
573
+ if x.catalog
574
+ else None,
573
575
  namespace=[
574
576
  normalize_string(y, from_dialect="execution", to_dialect="output")
575
577
  for y in x.namespace
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 3.2.0
3
+ Version: 3.3.1
4
4
  Summary: Turning PySpark Into a Universal DataFrame API
5
5
  Home-page: https://github.com/eakmanrq/sqlframe
6
6
  Author: Ryan Eakman
@@ -185,6 +185,105 @@ tests/fixtures/employee_delta/part-00008-89ccad8d-df73-4ad5-8850-82ef3884db60-c0
185
185
  tests/fixtures/employee_delta/part-00010-812b3382-8c7f-4c4e-9bcd-09ce8664f6e0-c000.snappy.parquet
186
186
  tests/fixtures/employee_delta/_delta_log/.00000000000000000000.json.crc
187
187
  tests/fixtures/employee_delta/_delta_log/00000000000000000000.json
188
+ tests/fixtures/tpcds/tpcds1.sql
189
+ tests/fixtures/tpcds/tpcds10.sql
190
+ tests/fixtures/tpcds/tpcds11.sql
191
+ tests/fixtures/tpcds/tpcds12.sql
192
+ tests/fixtures/tpcds/tpcds13.sql
193
+ tests/fixtures/tpcds/tpcds14.sql
194
+ tests/fixtures/tpcds/tpcds15.sql
195
+ tests/fixtures/tpcds/tpcds16.sql
196
+ tests/fixtures/tpcds/tpcds17.sql
197
+ tests/fixtures/tpcds/tpcds18.sql
198
+ tests/fixtures/tpcds/tpcds19.sql
199
+ tests/fixtures/tpcds/tpcds2.sql
200
+ tests/fixtures/tpcds/tpcds20.sql
201
+ tests/fixtures/tpcds/tpcds21.sql
202
+ tests/fixtures/tpcds/tpcds22.sql
203
+ tests/fixtures/tpcds/tpcds23.sql
204
+ tests/fixtures/tpcds/tpcds24.sql
205
+ tests/fixtures/tpcds/tpcds25.sql
206
+ tests/fixtures/tpcds/tpcds26.sql
207
+ tests/fixtures/tpcds/tpcds27.sql
208
+ tests/fixtures/tpcds/tpcds28.sql
209
+ tests/fixtures/tpcds/tpcds29.sql
210
+ tests/fixtures/tpcds/tpcds3.sql
211
+ tests/fixtures/tpcds/tpcds30.sql
212
+ tests/fixtures/tpcds/tpcds31.sql
213
+ tests/fixtures/tpcds/tpcds32.sql
214
+ tests/fixtures/tpcds/tpcds33.sql
215
+ tests/fixtures/tpcds/tpcds34.sql
216
+ tests/fixtures/tpcds/tpcds35.sql
217
+ tests/fixtures/tpcds/tpcds36.sql
218
+ tests/fixtures/tpcds/tpcds37.sql
219
+ tests/fixtures/tpcds/tpcds38.sql
220
+ tests/fixtures/tpcds/tpcds39.sql
221
+ tests/fixtures/tpcds/tpcds4.sql
222
+ tests/fixtures/tpcds/tpcds40.sql
223
+ tests/fixtures/tpcds/tpcds41.sql
224
+ tests/fixtures/tpcds/tpcds42.sql
225
+ tests/fixtures/tpcds/tpcds43.sql
226
+ tests/fixtures/tpcds/tpcds44.sql
227
+ tests/fixtures/tpcds/tpcds45.sql
228
+ tests/fixtures/tpcds/tpcds46.sql
229
+ tests/fixtures/tpcds/tpcds47.sql
230
+ tests/fixtures/tpcds/tpcds48.sql
231
+ tests/fixtures/tpcds/tpcds49.sql
232
+ tests/fixtures/tpcds/tpcds5.sql
233
+ tests/fixtures/tpcds/tpcds50.sql
234
+ tests/fixtures/tpcds/tpcds51.sql
235
+ tests/fixtures/tpcds/tpcds52.sql
236
+ tests/fixtures/tpcds/tpcds53.sql
237
+ tests/fixtures/tpcds/tpcds54.sql
238
+ tests/fixtures/tpcds/tpcds55.sql
239
+ tests/fixtures/tpcds/tpcds56.sql
240
+ tests/fixtures/tpcds/tpcds57.sql
241
+ tests/fixtures/tpcds/tpcds58.sql
242
+ tests/fixtures/tpcds/tpcds59.sql
243
+ tests/fixtures/tpcds/tpcds6.sql
244
+ tests/fixtures/tpcds/tpcds60.sql
245
+ tests/fixtures/tpcds/tpcds61.sql
246
+ tests/fixtures/tpcds/tpcds62.sql
247
+ tests/fixtures/tpcds/tpcds63.sql
248
+ tests/fixtures/tpcds/tpcds64.sql
249
+ tests/fixtures/tpcds/tpcds65.sql
250
+ tests/fixtures/tpcds/tpcds66.sql
251
+ tests/fixtures/tpcds/tpcds67.sql
252
+ tests/fixtures/tpcds/tpcds68.sql
253
+ tests/fixtures/tpcds/tpcds69.sql
254
+ tests/fixtures/tpcds/tpcds7.sql
255
+ tests/fixtures/tpcds/tpcds70.sql
256
+ tests/fixtures/tpcds/tpcds71.sql
257
+ tests/fixtures/tpcds/tpcds72.sql
258
+ tests/fixtures/tpcds/tpcds73.sql
259
+ tests/fixtures/tpcds/tpcds74.sql
260
+ tests/fixtures/tpcds/tpcds75.sql
261
+ tests/fixtures/tpcds/tpcds76.sql
262
+ tests/fixtures/tpcds/tpcds77.sql
263
+ tests/fixtures/tpcds/tpcds78.sql
264
+ tests/fixtures/tpcds/tpcds79.sql
265
+ tests/fixtures/tpcds/tpcds8.sql
266
+ tests/fixtures/tpcds/tpcds80.sql
267
+ tests/fixtures/tpcds/tpcds81.sql
268
+ tests/fixtures/tpcds/tpcds82.sql
269
+ tests/fixtures/tpcds/tpcds83.sql
270
+ tests/fixtures/tpcds/tpcds84.sql
271
+ tests/fixtures/tpcds/tpcds85.sql
272
+ tests/fixtures/tpcds/tpcds86.sql
273
+ tests/fixtures/tpcds/tpcds87.sql
274
+ tests/fixtures/tpcds/tpcds88.sql
275
+ tests/fixtures/tpcds/tpcds89.sql
276
+ tests/fixtures/tpcds/tpcds9.sql
277
+ tests/fixtures/tpcds/tpcds90.sql
278
+ tests/fixtures/tpcds/tpcds91.sql
279
+ tests/fixtures/tpcds/tpcds92.sql
280
+ tests/fixtures/tpcds/tpcds93.sql
281
+ tests/fixtures/tpcds/tpcds94.sql
282
+ tests/fixtures/tpcds/tpcds95.sql
283
+ tests/fixtures/tpcds/tpcds96.sql
284
+ tests/fixtures/tpcds/tpcds97.sql
285
+ tests/fixtures/tpcds/tpcds98.sql
286
+ tests/fixtures/tpcds/tpcds99.sql
188
287
  tests/integration/__init__.py
189
288
  tests/integration/fixtures.py
190
289
  tests/integration/test_int_dataframe.py
@@ -210,6 +309,7 @@ tests/integration/engines/duck/test_duckdb_dataframe.py
210
309
  tests/integration/engines/duck/test_duckdb_reader.py
211
310
  tests/integration/engines/duck/test_duckdb_session.py
212
311
  tests/integration/engines/duck/test_duckdb_udf.py
312
+ tests/integration/engines/duck/test_tpcds.py
213
313
  tests/integration/engines/postgres/__init__.py
214
314
  tests/integration/engines/postgres/test_postgres_activate.py
215
315
  tests/integration/engines/postgres/test_postgres_catalog.py
@@ -1,5 +1,5 @@
1
1
  prettytable<3.11.1
2
- sqlglot<25.19,>=24.0.0
2
+ sqlglot<25.23,>=24.0.0
3
3
  typing_extensions<5,>=4.8
4
4
 
5
5
  [bigquery]
@@ -7,10 +7,10 @@ google-cloud-bigquery-storage<3,>=2
7
7
  google-cloud-bigquery[pandas]<4,>=3
8
8
 
9
9
  [dev]
10
- duckdb<1.1,>=0.9
10
+ duckdb<1.2,>=0.9
11
11
  findspark<3,>=2
12
12
  mypy<1.12,>=1.10.0
13
- openai<1.44,>=1.30
13
+ openai<1.48,>=1.30
14
14
  pandas-stubs<3,>=2
15
15
  pandas<3,>=2
16
16
  psycopg<4,>=3.1
@@ -36,11 +36,11 @@ mkdocs==1.4.2
36
36
  pymdown-extensions
37
37
 
38
38
  [duckdb]
39
- duckdb<1.1,>=0.9
39
+ duckdb<1.2,>=0.9
40
40
  pandas<3,>=2
41
41
 
42
42
  [openai]
43
- openai<1.44,>=1.30
43
+ openai<1.48,>=1.30
44
44
 
45
45
  [pandas]
46
46
  pandas<3,>=2
@@ -2,12 +2,15 @@ from __future__ import annotations
2
2
 
3
3
  import os
4
4
  import typing as t
5
+ from pathlib import Path
5
6
 
7
+ import duckdb
6
8
  import pytest
7
9
  from pyspark import SparkConf
8
10
  from pyspark.sql import SparkSession as PySparkSession
9
11
  from pytest_postgresql.janitor import DatabaseJanitor
10
12
 
13
+ from sqlframe.base.session import _BaseSession
11
14
  from sqlframe.bigquery.session import BigQuerySession
12
15
  from sqlframe.duckdb.session import DuckDBSession
13
16
  from sqlframe.postgres.session import PostgresSession
@@ -28,8 +31,57 @@ if t.TYPE_CHECKING:
28
31
  from tests.types import EmployeeData
29
32
 
30
33
 
34
+ def load_tpcds(paths: t.List[Path], session: t.Union[_BaseSession, PySparkSession]):
35
+ for path in paths:
36
+ table_name = path.name
37
+ session.read.parquet(str(path / "*.parquet")).createOrReplaceTempView(table_name)
38
+
39
+
31
40
  @pytest.fixture(scope="session")
32
- def pyspark_session(tmp_path_factory) -> PySparkSession:
41
+ def gen_tpcds(tmp_path_factory) -> t.List[Path]:
42
+ path_root = tmp_path_factory.mktemp("tpcds")
43
+ results = []
44
+ tables = [
45
+ "web_site",
46
+ "web_sales",
47
+ "web_returns",
48
+ "web_page",
49
+ "warehouse",
50
+ "time_dim",
51
+ "store_sales",
52
+ "store_returns",
53
+ "store",
54
+ "ship_mode",
55
+ "reason",
56
+ "promotion",
57
+ "item",
58
+ "inventory",
59
+ "income_band",
60
+ "household_demographics",
61
+ "date_dim",
62
+ "customer_demographics",
63
+ "customer_address",
64
+ "customer",
65
+ "catalog_sales",
66
+ "catalog_returns",
67
+ "catalog_page",
68
+ "call_center",
69
+ ]
70
+ con = duckdb.connect()
71
+ con.sql("CALL dsdgen(sf=0.01)")
72
+ for table in tables:
73
+ path = path_root / table
74
+ path.mkdir(parents=True)
75
+ con.sql(
76
+ f"COPY (SELECT * FROM {table}) TO '{path}' (FORMAT PARQUET, PER_THREAD_OUTPUT TRUE)"
77
+ )
78
+ results.append(path)
79
+ con.close()
80
+ return results
81
+
82
+
83
+ @pytest.fixture(scope="session")
84
+ def pyspark_session(tmp_path_factory, gen_tpcds: t.List[Path]) -> PySparkSession:
33
85
  data_dir = tmp_path_factory.mktemp("spark_connection")
34
86
  derby_dir = tmp_path_factory.mktemp("derby")
35
87
  spark = (
@@ -49,6 +101,7 @@ def pyspark_session(tmp_path_factory) -> PySparkSession:
49
101
  spark.sql("CREATE TABLE db1.table1 (id INTEGER, name STRING)")
50
102
  spark.catalog.registerFunction("add", lambda x, y: x + y)
51
103
  spark.catalog.setCurrentDatabase("db1")
104
+ load_tpcds(gen_tpcds, spark)
52
105
  return spark
53
106
 
54
107
 
@@ -64,11 +117,7 @@ def spark_session(pyspark_session: PySparkSession) -> SparkSession:
64
117
 
65
118
  @pytest.fixture(scope="function")
66
119
  def duckdb_session() -> DuckDBSession:
67
- from duckdb import connect
68
-
69
- # https://github.com/duckdb/duckdb/issues/11404
70
- connection = connect()
71
- connection.sql("set TimeZone = 'UTC'")
120
+ connection = duckdb.connect(config={"TimeZone": "UTC"})
72
121
  return DuckDBSession(conn=connection)
73
122
 
74
123
 
@@ -0,0 +1,23 @@
1
+ WITH customer_total_return AS
2
+ (SELECT sr_customer_sk AS ctr_customer_sk,
3
+ sr_store_sk AS ctr_store_sk,
4
+ sum(sr_return_amt) AS ctr_total_return
5
+ FROM store_returns,
6
+ date_dim
7
+ WHERE sr_returned_date_sk = d_date_sk
8
+ AND d_year = 2000
9
+ GROUP BY sr_customer_sk,
10
+ sr_store_sk)
11
+ SELECT c_customer_id
12
+ FROM customer_total_return ctr1,
13
+ store,
14
+ customer
15
+ WHERE ctr1.ctr_total_return >
16
+ (SELECT avg(ctr_total_return)*1.2
17
+ FROM customer_total_return ctr2
18
+ WHERE ctr1.ctr_store_sk = ctr2.ctr_store_sk)
19
+ AND s_store_sk = ctr1.ctr_store_sk
20
+ AND s_state = 'TN'
21
+ AND ctr1.ctr_customer_sk = c_customer_sk
22
+ ORDER BY c_customer_id
23
+ LIMIT 100;
@@ -0,0 +1,65 @@
1
+ SELECT cd_gender,
2
+ cd_marital_status,
3
+ cd_education_status,
4
+ count(*) cnt1,
5
+ cd_purchase_estimate,
6
+ count(*) cnt2,
7
+ cd_credit_rating,
8
+ count(*) cnt3,
9
+ cd_dep_count,
10
+ count(*) cnt4,
11
+ cd_dep_employed_count,
12
+ count(*) cnt5,
13
+ cd_dep_college_count,
14
+ count(*) cnt6
15
+ FROM customer c,
16
+ customer_address ca,
17
+ customer_demographics
18
+ WHERE c.c_current_addr_sk = ca.ca_address_sk
19
+ AND ca_county IN ('Rush County',
20
+ 'Toole County',
21
+ 'Jefferson County',
22
+ 'Dona Ana County',
23
+ 'La Porte County')
24
+ AND cd_demo_sk = c.c_current_cdemo_sk
25
+ AND EXISTS
26
+ (SELECT *
27
+ FROM store_sales,
28
+ date_dim
29
+ WHERE c.c_customer_sk = ss_customer_sk
30
+ AND ss_sold_date_sk = d_date_sk
31
+ AND d_year = 2002
32
+ AND d_moy BETWEEN 1 AND 1+3)
33
+ AND (EXISTS
34
+ (SELECT *
35
+ FROM web_sales,
36
+ date_dim
37
+ WHERE c.c_customer_sk = ws_bill_customer_sk
38
+ AND ws_sold_date_sk = d_date_sk
39
+ AND d_year = 2002
40
+ AND d_moy BETWEEN 1 AND 1+3)
41
+ OR EXISTS
42
+ (SELECT *
43
+ FROM catalog_sales,
44
+ date_dim
45
+ WHERE c.c_customer_sk = cs_ship_customer_sk
46
+ AND cs_sold_date_sk = d_date_sk
47
+ AND d_year = 2002
48
+ AND d_moy BETWEEN 1 AND 1+3))
49
+ GROUP BY cd_gender,
50
+ cd_marital_status,
51
+ cd_education_status,
52
+ cd_purchase_estimate,
53
+ cd_credit_rating,
54
+ cd_dep_count,
55
+ cd_dep_employed_count,
56
+ cd_dep_college_count
57
+ ORDER BY cd_gender,
58
+ cd_marital_status,
59
+ cd_education_status,
60
+ cd_purchase_estimate,
61
+ cd_credit_rating,
62
+ cd_dep_count,
63
+ cd_dep_employed_count,
64
+ cd_dep_college_count
65
+ LIMIT 100;
@@ -0,0 +1,80 @@
1
+ WITH year_total AS
2
+ (SELECT c_customer_id customer_id,
3
+ c_first_name customer_first_name,
4
+ c_last_name customer_last_name,
5
+ c_preferred_cust_flag customer_preferred_cust_flag,
6
+ c_birth_country customer_birth_country,
7
+ c_login customer_login,
8
+ c_email_address customer_email_address,
9
+ d_year dyear,
10
+ sum(ss_ext_list_price-ss_ext_discount_amt) year_total,
11
+ 's' sale_type
12
+ FROM customer,
13
+ store_sales,
14
+ date_dim
15
+ WHERE c_customer_sk = ss_customer_sk
16
+ AND ss_sold_date_sk = d_date_sk
17
+ GROUP BY c_customer_id,
18
+ c_first_name,
19
+ c_last_name,
20
+ c_preferred_cust_flag,
21
+ c_birth_country,
22
+ c_login,
23
+ c_email_address,
24
+ d_year
25
+ UNION ALL SELECT c_customer_id customer_id,
26
+ c_first_name customer_first_name,
27
+ c_last_name customer_last_name,
28
+ c_preferred_cust_flag customer_preferred_cust_flag,
29
+ c_birth_country customer_birth_country,
30
+ c_login customer_login,
31
+ c_email_address customer_email_address,
32
+ d_year dyear,
33
+ sum(ws_ext_list_price-ws_ext_discount_amt) year_total,
34
+ 'w' sale_type
35
+ FROM customer,
36
+ web_sales,
37
+ date_dim
38
+ WHERE c_customer_sk = ws_bill_customer_sk
39
+ AND ws_sold_date_sk = d_date_sk
40
+ GROUP BY c_customer_id,
41
+ c_first_name,
42
+ c_last_name,
43
+ c_preferred_cust_flag,
44
+ c_birth_country,
45
+ c_login,
46
+ c_email_address,
47
+ d_year)
48
+ SELECT t_s_secyear.customer_id,
49
+ t_s_secyear.customer_first_name,
50
+ t_s_secyear.customer_last_name,
51
+ t_s_secyear.customer_preferred_cust_flag
52
+ FROM year_total t_s_firstyear,
53
+ year_total t_s_secyear,
54
+ year_total t_w_firstyear,
55
+ year_total t_w_secyear
56
+ WHERE t_s_secyear.customer_id = t_s_firstyear.customer_id
57
+ AND t_s_firstyear.customer_id = t_w_secyear.customer_id
58
+ AND t_s_firstyear.customer_id = t_w_firstyear.customer_id
59
+ AND t_s_firstyear.sale_type = 's'
60
+ AND t_w_firstyear.sale_type = 'w'
61
+ AND t_s_secyear.sale_type = 's'
62
+ AND t_w_secyear.sale_type = 'w'
63
+ AND t_s_firstyear.dyear = 2001
64
+ AND t_s_secyear.dyear = 2001+1
65
+ AND t_w_firstyear.dyear = 2001
66
+ AND t_w_secyear.dyear = 2001+1
67
+ AND t_s_firstyear.year_total > 0
68
+ AND t_w_firstyear.year_total > 0
69
+ AND CASE
70
+ WHEN t_w_firstyear.year_total > 0 THEN (t_w_secyear.year_total*1.0000) / t_w_firstyear.year_total
71
+ ELSE 0.0
72
+ END > CASE
73
+ WHEN t_s_firstyear.year_total > 0 THEN (t_s_secyear.year_total*1.0000) / t_s_firstyear.year_total
74
+ ELSE 0.0
75
+ END
76
+ ORDER BY t_s_secyear.customer_id NULLS FIRST,
77
+ t_s_secyear.customer_first_name NULLS FIRST,
78
+ t_s_secyear.customer_last_name NULLS FIRST,
79
+ t_s_secyear.customer_preferred_cust_flag NULLS FIRST
80
+ LIMIT 100;
@@ -0,0 +1,27 @@
1
+ SELECT i_item_id,
2
+ i_item_desc,
3
+ i_category,
4
+ i_class,
5
+ i_current_price,
6
+ sum(ws_ext_sales_price) AS itemrevenue,
7
+ sum(ws_ext_sales_price)*100.0000/sum(sum(ws_ext_sales_price)) OVER (PARTITION BY i_class) AS revenueratio
8
+ FROM web_sales,
9
+ item,
10
+ date_dim
11
+ WHERE ws_item_sk = i_item_sk
12
+ AND i_category IN ('Sports',
13
+ 'Books',
14
+ 'Home')
15
+ AND ws_sold_date_sk = d_date_sk
16
+ AND d_date BETWEEN cast('1999-02-22' AS date) AND cast('1999-03-24' AS date)
17
+ GROUP BY i_item_id,
18
+ i_item_desc,
19
+ i_category,
20
+ i_class,
21
+ i_current_price
22
+ ORDER BY i_category,
23
+ i_class,
24
+ i_item_id,
25
+ i_item_desc,
26
+ revenueratio
27
+ LIMIT 100;
@@ -0,0 +1,41 @@
1
+ SELECT avg(ss_quantity) avg1,
2
+ avg(ss_ext_sales_price) avg2,
3
+ avg(ss_ext_wholesale_cost) avg3,
4
+ sum(ss_ext_wholesale_cost)
5
+ FROM store_sales ,
6
+ store ,
7
+ customer_demographics ,
8
+ household_demographics ,
9
+ customer_address ,
10
+ date_dim
11
+ WHERE s_store_sk = ss_store_sk
12
+ AND ss_sold_date_sk = d_date_sk
13
+ AND d_year = 2001 and((ss_hdemo_sk=hd_demo_sk
14
+ AND cd_demo_sk = ss_cdemo_sk
15
+ AND cd_marital_status = 'M'
16
+ AND cd_education_status = 'Advanced Degree'
17
+ AND ss_sales_price BETWEEN 100.00 AND 150.00
18
+ AND hd_dep_count = 3)
19
+ OR (ss_hdemo_sk=hd_demo_sk
20
+ AND cd_demo_sk = ss_cdemo_sk
21
+ AND cd_marital_status = 'S'
22
+ AND cd_education_status = 'College'
23
+ AND ss_sales_price BETWEEN 50.00 AND 100.00
24
+ AND hd_dep_count = 1 )
25
+ OR (ss_hdemo_sk=hd_demo_sk
26
+ AND cd_demo_sk = ss_cdemo_sk
27
+ AND cd_marital_status = 'W'
28
+ AND cd_education_status = '2 yr Degree'
29
+ AND ss_sales_price BETWEEN 150.00 AND 200.00
30
+ AND hd_dep_count = 1)) and((ss_addr_sk = ca_address_sk
31
+ AND ca_country = 'United States'
32
+ AND ca_state IN ('TX', 'OH', 'TX')
33
+ AND ss_net_profit BETWEEN 100 AND 200)
34
+ OR (ss_addr_sk = ca_address_sk
35
+ AND ca_country = 'United States'
36
+ AND ca_state IN ('OR', 'NM', 'KY')
37
+ AND ss_net_profit BETWEEN 150 AND 300)
38
+ OR (ss_addr_sk = ca_address_sk
39
+ AND ca_country = 'United States'
40
+ AND ca_state IN ('VA', 'TX', 'MS')
41
+ AND ss_net_profit BETWEEN 50 AND 250));