sqlframe 2.1.0__py3-none-any.whl → 2.2.0__py3-none-any.whl
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/_version.py +2 -2
- sqlframe/base/dataframe.py +8 -0
- {sqlframe-2.1.0.dist-info → sqlframe-2.2.0.dist-info}/METADATA +2 -2
- {sqlframe-2.1.0.dist-info → sqlframe-2.2.0.dist-info}/RECORD +7 -7
- {sqlframe-2.1.0.dist-info → sqlframe-2.2.0.dist-info}/LICENSE +0 -0
- {sqlframe-2.1.0.dist-info → sqlframe-2.2.0.dist-info}/WHEEL +0 -0
- {sqlframe-2.1.0.dist-info → sqlframe-2.2.0.dist-info}/top_level.txt +0 -0
sqlframe/_version.py
CHANGED
sqlframe/base/dataframe.py
CHANGED
|
@@ -17,6 +17,7 @@ import sqlglot
|
|
|
17
17
|
from prettytable import PrettyTable
|
|
18
18
|
from sqlglot import Dialect
|
|
19
19
|
from sqlglot import expressions as exp
|
|
20
|
+
from sqlglot import lineage as sqlglot_lineage
|
|
20
21
|
from sqlglot.helper import ensure_list, flatten, object_to_dict, seq_get
|
|
21
22
|
from sqlglot.optimizer.pushdown_projections import pushdown_projections
|
|
22
23
|
from sqlglot.optimizer.qualify import qualify
|
|
@@ -1613,6 +1614,13 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
1613
1614
|
0,
|
|
1614
1615
|
)
|
|
1615
1616
|
|
|
1617
|
+
def lineage(self, col: ColumnOrName, optimize: bool = True) -> sqlglot_lineage.Node:
|
|
1618
|
+
return sqlglot_lineage.lineage(
|
|
1619
|
+
column=self._ensure_and_normalize_col(col).alias_or_name,
|
|
1620
|
+
sql=self._get_expressions(optimize=optimize)[0],
|
|
1621
|
+
schema=self.session.catalog._schema,
|
|
1622
|
+
)
|
|
1623
|
+
|
|
1616
1624
|
def toPandas(self) -> pd.DataFrame:
|
|
1617
1625
|
return self.session._fetchdf(self._get_expressions(optimize=False))
|
|
1618
1626
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sqlframe
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.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
|
|
@@ -123,7 +123,7 @@ from sqlframe.bigquery import functions as F
|
|
|
123
123
|
from sqlframe.bigquery import Window
|
|
124
124
|
|
|
125
125
|
session = BigQuerySession()
|
|
126
|
-
table_path = "bigquery-public-data.samples.natality
|
|
126
|
+
table_path = '"bigquery-public-data".samples.natality'
|
|
127
127
|
# Top 5 years with the greatest year-over-year % change in new families with single child
|
|
128
128
|
df = (
|
|
129
129
|
session.table(table_path)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
sqlframe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
sqlframe/_version.py,sha256=
|
|
2
|
+
sqlframe/_version.py,sha256=pbL_Q6fDSZl5UbKP04ZFdzrJpd1PO1gH7IwJCwLV7mk,411
|
|
3
3
|
sqlframe/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
sqlframe/base/_typing.py,sha256=b2clI5HI1zEZKB_3Msx3FeAJQyft44ubUifJwQRVXyQ,1298
|
|
5
5
|
sqlframe/base/catalog.py,sha256=SzFQalTWdhWzxUY-4ut1f9TfOECp_JmJEgNPfrRKCe0,38457
|
|
6
6
|
sqlframe/base/column.py,sha256=csci74Cdi7S7xpyAUfX6QVvlPDe4uR-S8Ejb50uCIfI,17698
|
|
7
|
-
sqlframe/base/dataframe.py,sha256=
|
|
7
|
+
sqlframe/base/dataframe.py,sha256=CHoSK7g9ceuX_4c8yL3nbq1nb15dGt2g_W0UBlBA-Nc,71132
|
|
8
8
|
sqlframe/base/decorators.py,sha256=Jy4bf8MhZ-AJ6CWTj59bBJRqamtLbPC0USUMFrY6g0w,449
|
|
9
9
|
sqlframe/base/exceptions.py,sha256=9Uwvqn2eAkDpqm4BrRgbL61qM-GMCbJEMAW8otxO46s,370
|
|
10
10
|
sqlframe/base/function_alternatives.py,sha256=VpBE1-p4_WifKoqeLJbZQFZ5MWJhNAEYCiQ2eE3hAOk,50015
|
|
@@ -107,8 +107,8 @@ sqlframe/standalone/udf.py,sha256=azmgtUjHNIPs0WMVNId05SHwiYn41MKVBhKXsQJ5dmY,27
|
|
|
107
107
|
sqlframe/standalone/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
|
108
108
|
sqlframe/testing/__init__.py,sha256=VVCosQhitU74A3NnE52O4mNtGZONapuEXcc20QmSlnQ,132
|
|
109
109
|
sqlframe/testing/utils.py,sha256=9DDYVuocO7tygee3RaajuJNZ24sJwf_LY556kKg7kTw,13011
|
|
110
|
-
sqlframe-2.
|
|
111
|
-
sqlframe-2.
|
|
112
|
-
sqlframe-2.
|
|
113
|
-
sqlframe-2.
|
|
114
|
-
sqlframe-2.
|
|
110
|
+
sqlframe-2.2.0.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
|
111
|
+
sqlframe-2.2.0.dist-info/METADATA,sha256=pqYUjHrpBUzW9MSavQAH-9bj6lQceMd3UPhWrbEP2Ew,7812
|
|
112
|
+
sqlframe-2.2.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
113
|
+
sqlframe-2.2.0.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
|
114
|
+
sqlframe-2.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|