sqlframe 0.1.dev3__py3-none-any.whl → 1.1.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/catalog.py +2 -1
- sqlframe/base/dataframe.py +9 -6
- sqlframe/base/decorators.py +6 -6
- sqlframe/base/mixins/readwriter_mixins.py +3 -0
- sqlframe/base/operations.py +7 -7
- sqlframe/base/session.py +7 -15
- sqlframe/base/transforms.py +3 -1
- sqlframe/base/util.py +6 -3
- sqlframe/bigquery/catalog.py +3 -2
- sqlframe/bigquery/session.py +3 -2
- sqlframe/duckdb/readwriter.py +18 -6
- {sqlframe-0.1.dev3.dist-info → sqlframe-1.1.0.dist-info}/METADATA +61 -59
- {sqlframe-0.1.dev3.dist-info → sqlframe-1.1.0.dist-info}/RECORD +17 -20
- {sqlframe-0.1.dev3.dist-info → sqlframe-1.1.0.dist-info}/WHEEL +1 -1
- sqlframe/bigquery/functions.pyi +0 -269
- sqlframe/duckdb/functions.pyi +0 -183
- sqlframe/postgres/functions.pyi +0 -167
- {sqlframe-0.1.dev3.dist-info → sqlframe-1.1.0.dist-info}/LICENSE +0 -0
- {sqlframe-0.1.dev3.dist-info → sqlframe-1.1.0.dist-info}/top_level.txt +0 -0
sqlframe/_version.py
CHANGED
sqlframe/base/catalog.py
CHANGED
|
@@ -8,7 +8,7 @@ from sqlglot import MappingSchema, exp
|
|
|
8
8
|
|
|
9
9
|
from sqlframe.base.decorators import normalize
|
|
10
10
|
from sqlframe.base.exceptions import TableSchemaError
|
|
11
|
-
from sqlframe.base.util import to_schema
|
|
11
|
+
from sqlframe.base.util import ensure_column_mapping, to_schema
|
|
12
12
|
|
|
13
13
|
if t.TYPE_CHECKING:
|
|
14
14
|
from sqlglot.schema import ColumnMapping
|
|
@@ -82,6 +82,7 @@ class _BaseCatalog(t.Generic[SESSION, DF]):
|
|
|
82
82
|
raise TableSchemaError(
|
|
83
83
|
"This session does not have access to a catalog that can lookup column information. See docs for explicitly defining columns or using a session that can automatically determine this."
|
|
84
84
|
)
|
|
85
|
+
column_mapping = ensure_column_mapping(column_mapping) # type: ignore
|
|
85
86
|
self._schema.add_table(table, column_mapping, dialect=self.session.input_dialect)
|
|
86
87
|
|
|
87
88
|
@normalize(["dbName"])
|
sqlframe/base/dataframe.py
CHANGED
|
@@ -417,7 +417,7 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
417
417
|
from sqlframe.base.session import _BaseSession
|
|
418
418
|
|
|
419
419
|
value = expression.sql(dialect=_BaseSession().input_dialect).encode("utf-8")
|
|
420
|
-
hash = f"t{zlib.crc32(value)}"[:
|
|
420
|
+
hash = f"t{zlib.crc32(value)}"[:9]
|
|
421
421
|
return self.session._normalize_string(hash)
|
|
422
422
|
|
|
423
423
|
def _get_select_expressions(
|
|
@@ -606,8 +606,11 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
606
606
|
return df._convert_leaf_to_cte(sequence_id=new_sequence_id)
|
|
607
607
|
|
|
608
608
|
@operation(Operation.WHERE)
|
|
609
|
-
def where(self, column: t.Union[Column, bool], **kwargs) -> Self:
|
|
610
|
-
|
|
609
|
+
def where(self, column: t.Union[Column, str, bool], **kwargs) -> Self:
|
|
610
|
+
if isinstance(column, str):
|
|
611
|
+
col = sqlglot.parse_one(column, dialect=self.session.input_dialect)
|
|
612
|
+
else:
|
|
613
|
+
col = self._ensure_and_normalize_col(column)
|
|
611
614
|
return self.copy(expression=self.expression.where(col.expression))
|
|
612
615
|
|
|
613
616
|
filter = where
|
|
@@ -662,7 +665,7 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
662
665
|
| 16| Bob| 85|
|
|
663
666
|
+---+-----+------+
|
|
664
667
|
"""
|
|
665
|
-
return self.join.__wrapped__(self, other, how="cross")
|
|
668
|
+
return self.join.__wrapped__(self, other, how="cross") # type: ignore
|
|
666
669
|
|
|
667
670
|
@operation(Operation.FROM)
|
|
668
671
|
def join(
|
|
@@ -769,7 +772,7 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
769
772
|
new_df = self.copy(expression=join_expression)
|
|
770
773
|
new_df.pending_join_hints.extend(self.pending_join_hints)
|
|
771
774
|
new_df.pending_hints.extend(other_df.pending_hints)
|
|
772
|
-
new_df = new_df.select.__wrapped__(new_df, *select_column_names)
|
|
775
|
+
new_df = new_df.select.__wrapped__(new_df, *select_column_names) # type: ignore
|
|
773
776
|
return new_df
|
|
774
777
|
|
|
775
778
|
@operation(Operation.ORDER_BY)
|
|
@@ -1094,7 +1097,7 @@ class _BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
1094
1097
|
)
|
|
1095
1098
|
if existing_col_index:
|
|
1096
1099
|
expression = self.expression.copy()
|
|
1097
|
-
expression.expressions[existing_col_index] = col.expression
|
|
1100
|
+
expression.expressions[existing_col_index] = col.alias(colName).expression
|
|
1098
1101
|
return self.copy(expression=expression)
|
|
1099
1102
|
return self.copy().select(col.alias(colName), append=True)
|
|
1100
1103
|
|
sqlframe/base/decorators.py
CHANGED
|
@@ -11,7 +11,7 @@ if t.TYPE_CHECKING:
|
|
|
11
11
|
from sqlframe.base.catalog import _BaseCatalog
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def normalize(normalize_kwargs: t.List[str]):
|
|
14
|
+
def normalize(normalize_kwargs: t.List[str]) -> t.Callable[[t.Callable], t.Callable]:
|
|
15
15
|
"""
|
|
16
16
|
Decorator used around DataFrame methods to indicate what type of operation is being performed from the
|
|
17
17
|
ordered Operation enums. This is used to determine which operations should be performed on a CTE vs.
|
|
@@ -23,9 +23,9 @@ def normalize(normalize_kwargs: t.List[str]):
|
|
|
23
23
|
in cases where there is overlap in names.
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
-
def decorator(func: t.Callable):
|
|
26
|
+
def decorator(func: t.Callable) -> t.Callable:
|
|
27
27
|
@functools.wraps(func)
|
|
28
|
-
def wrapper(self: _BaseCatalog, *args, **kwargs):
|
|
28
|
+
def wrapper(self: _BaseCatalog, *args, **kwargs) -> _BaseCatalog:
|
|
29
29
|
kwargs.update(dict(zip(func.__code__.co_varnames[1:], args)))
|
|
30
30
|
for kwarg in normalize_kwargs:
|
|
31
31
|
if kwarg in kwargs:
|
|
@@ -43,9 +43,9 @@ def normalize(normalize_kwargs: t.List[str]):
|
|
|
43
43
|
return decorator
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
def func_metadata(unsupported_engines: t.Optional[t.Union[str, t.List[str]]] = None):
|
|
47
|
-
def _metadata(func):
|
|
48
|
-
func.unsupported_engines = ensure_list(unsupported_engines) if unsupported_engines else []
|
|
46
|
+
def func_metadata(unsupported_engines: t.Optional[t.Union[str, t.List[str]]] = None) -> t.Callable:
|
|
47
|
+
def _metadata(func: t.Callable) -> t.Callable:
|
|
48
|
+
func.unsupported_engines = ensure_list(unsupported_engines) if unsupported_engines else [] # type: ignore
|
|
49
49
|
return func
|
|
50
50
|
|
|
51
51
|
return _metadata
|
|
@@ -108,6 +108,9 @@ class PandasWriterMixin(_BaseDataFrameWriter, t.Generic[SESSION, DF]):
|
|
|
108
108
|
raise NotImplementedError("Append mode is not supported for parquet.")
|
|
109
109
|
pandas_df.to_parquet(path, **kwargs)
|
|
110
110
|
elif format == "json":
|
|
111
|
+
# Pandas versions are inconsistent on how to handle True/False index so we just remove it
|
|
112
|
+
# since in all versions it will not result in an index column in the output.
|
|
113
|
+
del kwargs["index"]
|
|
111
114
|
kwargs["mode"] = mode
|
|
112
115
|
kwargs["orient"] = "records"
|
|
113
116
|
pandas_df.to_json(path, lines=True, **kwargs)
|
sqlframe/base/operations.py
CHANGED
|
@@ -23,7 +23,7 @@ class Operation(IntEnum):
|
|
|
23
23
|
LIMIT = 7
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def operation(op: Operation):
|
|
26
|
+
def operation(op: Operation) -> t.Callable[[t.Callable], t.Callable]:
|
|
27
27
|
"""
|
|
28
28
|
Decorator used around DataFrame methods to indicate what type of operation is being performed from the
|
|
29
29
|
ordered Operation enums. This is used to determine which operations should be performed on a CTE vs.
|
|
@@ -35,9 +35,9 @@ def operation(op: Operation):
|
|
|
35
35
|
in cases where there is overlap in names.
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
|
-
def decorator(func: t.Callable):
|
|
38
|
+
def decorator(func: t.Callable) -> t.Callable:
|
|
39
39
|
@functools.wraps(func)
|
|
40
|
-
def wrapper(self: _BaseDataFrame, *args, **kwargs):
|
|
40
|
+
def wrapper(self: _BaseDataFrame, *args, **kwargs) -> _BaseDataFrame:
|
|
41
41
|
if self.last_op == Operation.INIT:
|
|
42
42
|
self = self._convert_leaf_to_cte()
|
|
43
43
|
self.last_op = Operation.NO_OP
|
|
@@ -47,7 +47,7 @@ def operation(op: Operation):
|
|
|
47
47
|
self = self._convert_leaf_to_cte()
|
|
48
48
|
df: t.Union[_BaseDataFrame, _BaseGroupedData] = func(self, *args, **kwargs)
|
|
49
49
|
df.last_op = new_op # type: ignore
|
|
50
|
-
return df
|
|
50
|
+
return df # type: ignore
|
|
51
51
|
|
|
52
52
|
wrapper.__wrapped__ = func # type: ignore
|
|
53
53
|
return wrapper
|
|
@@ -55,7 +55,7 @@ def operation(op: Operation):
|
|
|
55
55
|
return decorator
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
def group_operation(op: Operation):
|
|
58
|
+
def group_operation(op: Operation) -> t.Callable[[t.Callable], t.Callable]:
|
|
59
59
|
"""
|
|
60
60
|
Decorator used around DataFrame methods to indicate what type of operation is being performed from the
|
|
61
61
|
ordered Operation enums. This is used to determine which operations should be performed on a CTE vs.
|
|
@@ -67,9 +67,9 @@ def group_operation(op: Operation):
|
|
|
67
67
|
in cases where there is overlap in names.
|
|
68
68
|
"""
|
|
69
69
|
|
|
70
|
-
def decorator(func: t.Callable):
|
|
70
|
+
def decorator(func: t.Callable) -> t.Callable:
|
|
71
71
|
@functools.wraps(func)
|
|
72
|
-
def wrapper(self: _BaseGroupedData, *args, **kwargs):
|
|
72
|
+
def wrapper(self: _BaseGroupedData, *args, **kwargs) -> _BaseDataFrame:
|
|
73
73
|
if self._df.last_op == Operation.INIT:
|
|
74
74
|
self._df = self._df._convert_leaf_to_cte()
|
|
75
75
|
self._df.last_op = Operation.NO_OP
|
sqlframe/base/session.py
CHANGED
|
@@ -11,9 +11,9 @@ from collections import defaultdict
|
|
|
11
11
|
from functools import cached_property
|
|
12
12
|
|
|
13
13
|
import sqlglot
|
|
14
|
-
from more_itertools import take
|
|
15
14
|
from sqlglot import Dialect, exp
|
|
16
15
|
from sqlglot.expressions import parse_identifier
|
|
16
|
+
from sqlglot.helper import seq_get
|
|
17
17
|
from sqlglot.optimizer import optimize
|
|
18
18
|
from sqlglot.optimizer.normalize_identifiers import normalize_identifiers
|
|
19
19
|
from sqlglot.optimizer.qualify_columns import (
|
|
@@ -211,10 +211,10 @@ class _BaseSession(t.Generic[CATALOG, READER, WRITER, DF, CONN]):
|
|
|
211
211
|
row_types.append((row_name, default_type))
|
|
212
212
|
return "struct<" + ", ".join(f"{k}: {v}" for (k, v) in row_types) + ">"
|
|
213
213
|
elif isinstance(value, dict):
|
|
214
|
-
sample_row =
|
|
214
|
+
sample_row = seq_get(list(value.items()), 0)
|
|
215
215
|
if not sample_row:
|
|
216
216
|
return None
|
|
217
|
-
key, value = sample_row
|
|
217
|
+
key, value = sample_row
|
|
218
218
|
default_key = get_default_data_type(key)
|
|
219
219
|
default_value = get_default_data_type(value)
|
|
220
220
|
if not default_key or not default_value:
|
|
@@ -313,24 +313,16 @@ class _BaseSession(t.Generic[CATALOG, READER, WRITER, DF, CONN]):
|
|
|
313
313
|
sel_expression = exp.Select(**select_kwargs)
|
|
314
314
|
if empty_df:
|
|
315
315
|
sel_expression = sel_expression.where(exp.false())
|
|
316
|
-
# if empty_df:
|
|
317
|
-
# if not column_mapping:
|
|
318
|
-
# # If we don't have rows or columns then we just return a null with a false expression
|
|
319
|
-
# sel_expression = (
|
|
320
|
-
# exp.Select().select("null").from_("VALUES (NULL)").where(exp.false())
|
|
321
|
-
# )
|
|
322
|
-
# else:
|
|
323
|
-
# # Ensure no results are returned if the dataframe is expected to be empty instead of
|
|
324
|
-
# # a row of null values
|
|
325
|
-
# sel_expression = sel_expression.where(exp.false())
|
|
326
316
|
return self._create_df(sel_expression)
|
|
327
317
|
|
|
328
|
-
def sql(self, sqlQuery: t.Union[str, exp.Expression]) -> DF:
|
|
329
|
-
expression =
|
|
318
|
+
def sql(self, sqlQuery: t.Union[str, exp.Expression], optimize: bool = True) -> DF:
|
|
319
|
+
expression = (
|
|
330
320
|
sqlglot.parse_one(sqlQuery, read=self.input_dialect)
|
|
331
321
|
if isinstance(sqlQuery, str)
|
|
332
322
|
else sqlQuery
|
|
333
323
|
)
|
|
324
|
+
if optimize:
|
|
325
|
+
expression = self._optimize(expression)
|
|
334
326
|
if self.temp_views:
|
|
335
327
|
replacement_mapping = {}
|
|
336
328
|
for table in expression.find_all(exp.Table):
|
sqlframe/base/transforms.py
CHANGED
|
@@ -5,7 +5,9 @@ import typing as t
|
|
|
5
5
|
from sqlglot import expressions as exp
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def replace_id_value(
|
|
8
|
+
def replace_id_value(
|
|
9
|
+
node: exp.Expression, replacement_mapping: t.Dict[exp.Identifier, exp.Identifier]
|
|
10
|
+
) -> exp.Expression:
|
|
9
11
|
if isinstance(node, exp.Identifier) and node in replacement_mapping:
|
|
10
12
|
node = node.replace(replacement_mapping[node].copy())
|
|
11
13
|
return node
|
sqlframe/base/util.py
CHANGED
|
@@ -9,6 +9,7 @@ from sqlglot.dialects.dialect import Dialect, DialectType
|
|
|
9
9
|
from sqlglot.schema import ensure_column_mapping as sqlglot_ensure_column_mapping
|
|
10
10
|
|
|
11
11
|
if t.TYPE_CHECKING:
|
|
12
|
+
from pandas.core.frame import DataFrame as PandasDataFrame
|
|
12
13
|
from pyspark.sql.dataframe import SparkSession as PySparkSession
|
|
13
14
|
|
|
14
15
|
from sqlframe.base import types
|
|
@@ -97,7 +98,7 @@ def get_tables_from_expression_with_join(expression: exp.Select) -> t.List[exp.T
|
|
|
97
98
|
return [left_table] + other_tables
|
|
98
99
|
|
|
99
100
|
|
|
100
|
-
def to_csv(options: t.Dict[str, OptionalPrimitiveType], equality_char: str = "="):
|
|
101
|
+
def to_csv(options: t.Dict[str, OptionalPrimitiveType], equality_char: str = "=") -> str:
|
|
101
102
|
return ", ".join(
|
|
102
103
|
[f"{k}{equality_char}{v}" for k, v in (options or {}).items() if v is not None]
|
|
103
104
|
)
|
|
@@ -112,11 +113,13 @@ def ensure_column_mapping(schema: t.Union[str, StructType]) -> t.Dict:
|
|
|
112
113
|
}
|
|
113
114
|
# TODO: Make a protocol with a `simpleString` attribute as what it looks for instead of the actual
|
|
114
115
|
# `StructType` object.
|
|
116
|
+
elif hasattr(schema, "simpleString"):
|
|
117
|
+
return {struct_field.name: struct_field.dataType.simpleString() for struct_field in schema}
|
|
115
118
|
return sqlglot_ensure_column_mapping(schema) # type: ignore
|
|
116
119
|
|
|
117
120
|
|
|
118
121
|
# SO: https://stackoverflow.com/questions/37513355/converting-pandas-dataframe-into-spark-dataframe-error
|
|
119
|
-
def get_equivalent_spark_type(pandas_type):
|
|
122
|
+
def get_equivalent_spark_type(pandas_type) -> types.DataType:
|
|
120
123
|
"""
|
|
121
124
|
This method will retrieve the corresponding spark type given a pandas
|
|
122
125
|
type.
|
|
@@ -139,7 +142,7 @@ def get_equivalent_spark_type(pandas_type):
|
|
|
139
142
|
return type_map.get(str(pandas_type).lower(), types.StringType())
|
|
140
143
|
|
|
141
144
|
|
|
142
|
-
def pandas_to_spark_schema(pandas_df):
|
|
145
|
+
def pandas_to_spark_schema(pandas_df: PandasDataFrame) -> types.StructType:
|
|
143
146
|
"""
|
|
144
147
|
This method will return a spark dataframe schema given a pandas dataframe.
|
|
145
148
|
|
sqlframe/bigquery/catalog.py
CHANGED
|
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|
|
3
3
|
import fnmatch
|
|
4
4
|
import typing as t
|
|
5
5
|
|
|
6
|
-
from google.cloud.bigquery import StandardSqlDataType
|
|
7
6
|
from sqlglot import exp
|
|
8
7
|
|
|
9
8
|
from sqlframe.base.catalog import CatalogMetadata, Column, Function
|
|
@@ -16,8 +15,10 @@ from sqlframe.base.mixins.catalog_mixins import (
|
|
|
16
15
|
from sqlframe.base.util import schema_, to_schema
|
|
17
16
|
|
|
18
17
|
if t.TYPE_CHECKING:
|
|
19
|
-
from
|
|
18
|
+
from google.cloud.bigquery import StandardSqlDataType
|
|
19
|
+
|
|
20
20
|
from sqlframe.bigquery.dataframe import BigQueryDataFrame # noqa
|
|
21
|
+
from sqlframe.bigquery.session import BigQuerySession # noqa
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
class BigQueryCatalog(
|
sqlframe/bigquery/session.py
CHANGED
|
@@ -11,9 +11,10 @@ from sqlframe.bigquery.readwriter import (
|
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
if t.TYPE_CHECKING:
|
|
14
|
-
from google.cloud import
|
|
14
|
+
from google.cloud.bigquery.client import Client as BigQueryClient
|
|
15
15
|
from google.cloud.bigquery.dbapi.connection import Connection as BigQueryConnection
|
|
16
16
|
else:
|
|
17
|
+
BigQueryClient = t.Any
|
|
17
18
|
BigQueryConnection = t.Any
|
|
18
19
|
|
|
19
20
|
|
|
@@ -48,7 +49,7 @@ class BigQuerySession(
|
|
|
48
49
|
self.default_dataset = default_dataset
|
|
49
50
|
|
|
50
51
|
@property
|
|
51
|
-
def _client(self) ->
|
|
52
|
+
def _client(self) -> BigQueryClient:
|
|
52
53
|
assert self._connection
|
|
53
54
|
return self._connection._client
|
|
54
55
|
|
sqlframe/duckdb/readwriter.py
CHANGED
|
@@ -5,6 +5,9 @@ from __future__ import annotations
|
|
|
5
5
|
import logging
|
|
6
6
|
import typing as t
|
|
7
7
|
|
|
8
|
+
from sqlglot import exp
|
|
9
|
+
from sqlglot.helper import ensure_list
|
|
10
|
+
|
|
8
11
|
from sqlframe.base.readerwriter import _BaseDataFrameReader, _BaseDataFrameWriter
|
|
9
12
|
from sqlframe.base.util import ensure_column_mapping, to_csv
|
|
10
13
|
|
|
@@ -69,13 +72,22 @@ class DuckDBDataFrameReader(_BaseDataFrameReader["DuckDBSession", "DuckDBDataFra
|
|
|
69
72
|
|100|NULL|
|
|
70
73
|
+---+----+
|
|
71
74
|
"""
|
|
75
|
+
if schema:
|
|
76
|
+
column_mapping = ensure_column_mapping(schema)
|
|
77
|
+
select_columns = [x.expression for x in self._to_casted_columns(column_mapping)]
|
|
78
|
+
if format == "csv":
|
|
79
|
+
duckdb_columns = ", ".join(
|
|
80
|
+
[f"'{column}': '{dtype}'" for column, dtype in column_mapping.items()]
|
|
81
|
+
)
|
|
82
|
+
options["columns"] = "{" + duckdb_columns + "}"
|
|
83
|
+
else:
|
|
84
|
+
select_columns = [exp.Star()]
|
|
72
85
|
if format:
|
|
73
|
-
|
|
86
|
+
paths = ",".join([f"'{path}'" for path in ensure_list(path)])
|
|
87
|
+
from_clause = f"read_{format}([{paths}], {to_csv(options)})"
|
|
74
88
|
else:
|
|
75
|
-
|
|
76
|
-
df = self.session.sql(
|
|
77
|
-
if schema:
|
|
78
|
-
df = df.select(*self._to_casted_columns(ensure_column_mapping(schema)))
|
|
89
|
+
from_clause = f"'{path}'"
|
|
90
|
+
df = self.session.sql(exp.select(*select_columns).from_(from_clause), optimize=False)
|
|
79
91
|
self.session._last_loaded_file = path # type: ignore
|
|
80
92
|
return df
|
|
81
93
|
|
|
@@ -87,7 +99,7 @@ class DuckDBDataFrameWriter(_BaseDataFrameWriter["DuckDBSession", "DuckDBDataFra
|
|
|
87
99
|
return
|
|
88
100
|
if mode == "append":
|
|
89
101
|
raise NotImplementedError("Append mode not supported")
|
|
90
|
-
options = to_csv(options, equality_char=" ")
|
|
102
|
+
options = to_csv(options, equality_char=" ") # type: ignore
|
|
91
103
|
sqls = self._df.sql(pretty=False, optimize=False, as_list=True)
|
|
92
104
|
for i, sql in enumerate(sqls):
|
|
93
105
|
if i < len(sqls) - 1:
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sqlframe
|
|
3
|
-
Version:
|
|
4
|
-
Summary: PySpark
|
|
3
|
+
Version: 1.1.0
|
|
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
|
|
7
7
|
Author-email: eakmanrq@gmail.com
|
|
8
8
|
License: MIT
|
|
9
|
+
Platform: UNKNOWN
|
|
9
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
11
|
Classifier: Intended Audience :: Developers
|
|
11
12
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -16,60 +17,63 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
16
17
|
Requires-Python: >=3.8
|
|
17
18
|
Description-Content-Type: text/markdown
|
|
18
19
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: prettytable
|
|
20
|
-
Requires-Dist: sqlglot
|
|
20
|
+
Requires-Dist: prettytable (<3.11.0)
|
|
21
|
+
Requires-Dist: sqlglot (<24.1,>=24.0.0)
|
|
21
22
|
Provides-Extra: bigquery
|
|
22
|
-
Requires-Dist: google-cloud-bigquery
|
|
23
|
-
Requires-Dist: google-cloud-bigquery
|
|
23
|
+
Requires-Dist: google-cloud-bigquery-storage (<3,>=2) ; extra == 'bigquery'
|
|
24
|
+
Requires-Dist: google-cloud-bigquery[pandas] (<4,>=3) ; extra == 'bigquery'
|
|
25
|
+
Requires-Dist: pandas (<3,>=2) ; extra == 'bigquery'
|
|
24
26
|
Provides-Extra: dev
|
|
25
|
-
Requires-Dist: duckdb ; extra == 'dev'
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
Requires-Dist: pre-commit ; extra == 'dev'
|
|
40
|
-
|
|
41
|
-
Requires-Dist:
|
|
42
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: duckdb (<0.11,>=0.9) ; extra == 'dev'
|
|
28
|
+
Requires-Dist: mypy (<1.11,>=1.10.0) ; extra == 'dev'
|
|
29
|
+
Requires-Dist: pandas-stubs (<3,>=2) ; extra == 'dev'
|
|
30
|
+
Requires-Dist: pandas (<3,>=2) ; extra == 'dev'
|
|
31
|
+
Requires-Dist: psycopg (<4,>=3.1) ; extra == 'dev'
|
|
32
|
+
Requires-Dist: pyarrow (<17,>=10) ; extra == 'dev'
|
|
33
|
+
Requires-Dist: pyspark (<3.6,>=2) ; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-postgresql (<7,>=6) ; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest-xdist (<3.7,>=3.6) ; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest (<8.3,>=8.2.0) ; extra == 'dev'
|
|
37
|
+
Requires-Dist: ruff (<0.5,>=0.4.4) ; extra == 'dev'
|
|
38
|
+
Requires-Dist: types-psycopg2 (<3,>=2.9) ; extra == 'dev'
|
|
39
|
+
Requires-Dist: typing-extensions (<5,>=4.11) ; extra == 'dev'
|
|
40
|
+
Requires-Dist: pre-commit (>=3.5) ; (python_version == "3.8") and extra == 'dev'
|
|
41
|
+
Requires-Dist: pre-commit (<3.8,>=3.7) ; (python_version >= "3.9") and extra == 'dev'
|
|
42
|
+
Provides-Extra: docs
|
|
43
|
+
Requires-Dist: mkdocs-include-markdown-plugin (==4.0.3) ; extra == 'docs'
|
|
44
|
+
Requires-Dist: mkdocs-material-extensions (==1.1.1) ; extra == 'docs'
|
|
45
|
+
Requires-Dist: mkdocs-material (==9.0.5) ; extra == 'docs'
|
|
46
|
+
Requires-Dist: mkdocs (==1.4.2) ; extra == 'docs'
|
|
47
|
+
Requires-Dist: pymdown-extensions ; extra == 'docs'
|
|
43
48
|
Provides-Extra: duckdb
|
|
44
|
-
Requires-Dist: duckdb ; extra == 'duckdb'
|
|
45
|
-
Requires-Dist: pandas ; extra == 'duckdb'
|
|
49
|
+
Requires-Dist: duckdb (<0.11,>=0.9) ; extra == 'duckdb'
|
|
50
|
+
Requires-Dist: pandas (<3,>=2) ; extra == 'duckdb'
|
|
46
51
|
Provides-Extra: postgres
|
|
47
|
-
Requires-Dist:
|
|
52
|
+
Requires-Dist: pandas (<3,>=2) ; extra == 'postgres'
|
|
53
|
+
Requires-Dist: psycopg2 (<3,>=2.8) ; extra == 'postgres'
|
|
48
54
|
Provides-Extra: redshift
|
|
49
|
-
Requires-Dist:
|
|
55
|
+
Requires-Dist: pandas (<3,>=2) ; extra == 'redshift'
|
|
56
|
+
Requires-Dist: redshift-connector (<2.2.0,>=2.1.1) ; extra == 'redshift'
|
|
50
57
|
Provides-Extra: snowflake
|
|
51
|
-
Requires-Dist:
|
|
58
|
+
Requires-Dist: pandas (<3,>=2) ; extra == 'snowflake'
|
|
59
|
+
Requires-Dist: snowflake-connector-python[pandas,secure-local-storage] (<3.11,>=3.10.0) ; extra == 'snowflake'
|
|
52
60
|
Provides-Extra: spark
|
|
53
|
-
Requires-Dist: pyspark ; extra == 'spark'
|
|
61
|
+
Requires-Dist: pyspark (<3.6,>=2) ; extra == 'spark'
|
|
54
62
|
|
|
55
63
|
<div align="center">
|
|
56
|
-
<img src="docs/images/sqlframe_logo.png" alt="SQLFrame Logo" width="400"/>
|
|
64
|
+
<img src="https://sqlframe.readthedocs.io/en/latest/docs/images/sqlframe_logo.png" alt="SQLFrame Logo" width="400"/>
|
|
57
65
|
</div>
|
|
58
66
|
|
|
59
|
-

|
|
60
|
-
|
|
61
67
|
SQLFrame implements the PySpark DataFrame API in order to enable running transformation pipelines directly on database engines - no Spark clusters or dependencies required.
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
SQLFrame currently supports the following engines:
|
|
69
|
+
SQLFrame currently supports the following engines (many more in development):
|
|
66
70
|
|
|
67
|
-
* [BigQuery](
|
|
68
|
-
* [DuckDB](
|
|
69
|
-
* [Postgres](
|
|
71
|
+
* [BigQuery](https://sqlframe.readthedocs.io/en/latest/bigquery/)
|
|
72
|
+
* [DuckDB](https://sqlframe.readthedocs.io/en/latest/duckdb)
|
|
73
|
+
* [Postgres](https://sqlframe.readthedocs.io/en/latest/postgres)
|
|
70
74
|
|
|
71
75
|
SQLFrame also has a "Standalone" session that be used to generate SQL without any connection to a database engine.
|
|
72
|
-
* [Standalone](
|
|
76
|
+
* [Standalone](https://sqlframe.readthedocs.io/en/latest/standalone)
|
|
73
77
|
|
|
74
78
|
SQLFrame is great for:
|
|
75
79
|
|
|
@@ -101,7 +105,7 @@ from sqlframe.bigquery import Window
|
|
|
101
105
|
|
|
102
106
|
session = BigQuerySession()
|
|
103
107
|
table_path = "bigquery-public-data.samples.natality"
|
|
104
|
-
#
|
|
108
|
+
# Top 5 years with the greatest year-over-year % change in new families with single child
|
|
105
109
|
df = (
|
|
106
110
|
session.table(table_path)
|
|
107
111
|
.where(F.col("ever_born") == 1)
|
|
@@ -118,17 +122,15 @@ df = (
|
|
|
118
122
|
)
|
|
119
123
|
.orderBy(F.abs(F.col("percent_change")).desc())
|
|
120
124
|
.select(
|
|
121
|
-
F.col("year").alias("
|
|
122
|
-
F.format_number("num_single_child_families", 0).alias("
|
|
125
|
+
F.col("year").alias("year"),
|
|
126
|
+
F.format_number("num_single_child_families", 0).alias("new families single child"),
|
|
123
127
|
F.format_number(F.col("percent_change") * 100, 2).alias("percent change"),
|
|
124
128
|
)
|
|
125
129
|
.limit(5)
|
|
126
130
|
)
|
|
127
131
|
```
|
|
128
132
|
```python
|
|
129
|
-
df.sql()
|
|
130
|
-
```
|
|
131
|
-
```sql
|
|
133
|
+
>>> df.sql()
|
|
132
134
|
WITH `t94228` AS (
|
|
133
135
|
SELECT
|
|
134
136
|
`natality`.`year` AS `year`,
|
|
@@ -147,7 +149,7 @@ WITH `t94228` AS (
|
|
|
147
149
|
)
|
|
148
150
|
SELECT
|
|
149
151
|
`t39093`.`year` AS `year`,
|
|
150
|
-
FORMAT('%\'.0f', ROUND(CAST(`t39093`.`num_single_child_families` AS FLOAT64), 0)) AS `
|
|
152
|
+
FORMAT('%\'.0f', ROUND(CAST(`t39093`.`num_single_child_families` AS FLOAT64), 0)) AS `new families single child`,
|
|
151
153
|
FORMAT('%\'.2f', ROUND(CAST((((`t39093`.`num_single_child_families` - `t39093`.`last_year_num_single_child_families`) / `t39093`.`last_year_num_single_child_families`) * 100) AS FLOAT64), 2)) AS `percent change`
|
|
152
154
|
FROM `t39093` AS `t39093`
|
|
153
155
|
ORDER BY
|
|
@@ -155,16 +157,16 @@ ORDER BY
|
|
|
155
157
|
LIMIT 5
|
|
156
158
|
```
|
|
157
159
|
```python
|
|
158
|
-
df.show()
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
|
163
|
-
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
| 1975 | 868,985 | 10.92 |
|
|
169
|
-
+------+-------------------------------------+----------------+
|
|
160
|
+
>>> df.show()
|
|
161
|
+
+------+---------------------------+----------------+
|
|
162
|
+
| year | new families single child | percent change |
|
|
163
|
+
+------+---------------------------+----------------+
|
|
164
|
+
| 1989 | 1,650,246 | 25.02 |
|
|
165
|
+
| 1974 | 783,448 | 14.49 |
|
|
166
|
+
| 1977 | 1,057,379 | 11.38 |
|
|
167
|
+
| 1985 | 1,308,476 | 11.15 |
|
|
168
|
+
| 1975 | 868,985 | 10.92 |
|
|
169
|
+
+------+---------------------------+----------------+
|
|
170
170
|
```
|
|
171
|
+
|
|
172
|
+
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
sqlframe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
sqlframe/_version.py,sha256=
|
|
2
|
+
sqlframe/_version.py,sha256=CqDGE4B1ZqZ-56mxeOFcXRTmlxrdOh4ayrjbcPjziE4,411
|
|
3
3
|
sqlframe/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
sqlframe/base/_typing.py,sha256=DuTay8-o9W-pw3RPZCgLunKNJLS9PkaV11G_pxXp9NY,1256
|
|
5
|
-
sqlframe/base/catalog.py,sha256=
|
|
5
|
+
sqlframe/base/catalog.py,sha256=P55_mLrk9KUC2LRYyLgSzVAan1Lx6EBNfdDjMEtc9DA,37086
|
|
6
6
|
sqlframe/base/column.py,sha256=K9TtpBjVsFK9NtEX9ZQscU6qZIKiVVh1zj3jG9HifyA,15110
|
|
7
|
-
sqlframe/base/dataframe.py,sha256=
|
|
8
|
-
sqlframe/base/decorators.py,sha256=
|
|
7
|
+
sqlframe/base/dataframe.py,sha256=lNBMm79rX1DAt5vj4qKuxDwyhJdnhDROcOPcqVDxNHE,58971
|
|
8
|
+
sqlframe/base/decorators.py,sha256=fnqT1Hqa0J_gUurDcVY1Dcscj6SXFxFJ5PKAw-xe5sU,2097
|
|
9
9
|
sqlframe/base/exceptions.py,sha256=pCB9hXX4jxZWzNg3JN1i38cv3BmpUlee5NoLYx3YXIQ,208
|
|
10
10
|
sqlframe/base/function_alternatives.py,sha256=to0kv3MTJmQFeVTMcitz0AxBIoUJC3cu5LkEY5aJpoo,31318
|
|
11
11
|
sqlframe/base/functions.py,sha256=rm-8Mmz_156G3Hdwfdf-HF4HDeVkv0pBcDCJskoRINQ,53541
|
|
12
12
|
sqlframe/base/group.py,sha256=sKoaI2aLMih9nJTQfqzfJ00NbBcGQtArWXYHT40motQ,4060
|
|
13
13
|
sqlframe/base/normalize.py,sha256=Ie6IcrD9dL-xBUKgDoh_c_gfLw68tBK5AmiprCA8MXE,3633
|
|
14
|
-
sqlframe/base/operations.py,sha256=
|
|
14
|
+
sqlframe/base/operations.py,sha256=fVlAse6-WdQnEaHghRZVHXOesQ3OnKQwBnVYv5nVRiI,3457
|
|
15
15
|
sqlframe/base/readerwriter.py,sha256=cgg7KuO7Eu8fScKOg1KyNFAcgnsjpU6yusPVs0o52a4,25213
|
|
16
|
-
sqlframe/base/session.py,sha256=
|
|
17
|
-
sqlframe/base/transforms.py,sha256=
|
|
16
|
+
sqlframe/base/session.py,sha256=evVdd-FGKkp-Wg80UG5289iRtBihLFfkqrcXTH64_R8,21926
|
|
17
|
+
sqlframe/base/transforms.py,sha256=EKwUpfp83bncEs_MNmI2OO7gV6vA_Rr89ZWmE4eETSw,468
|
|
18
18
|
sqlframe/base/types.py,sha256=1CwMW9Q1inYzQcPTyjv1QANtVSHha8ZmBigmopQET98,11925
|
|
19
|
-
sqlframe/base/util.py,sha256=
|
|
19
|
+
sqlframe/base/util.py,sha256=SeUC2pcSBGnsS1W5PL1p-IGC6bJG8_2a7En2hxSTmpA,7597
|
|
20
20
|
sqlframe/base/window.py,sha256=yyKvoNi41vL2t7XK2Ysjp8Q2FNIu3BYv-9EPtp5og6k,4944
|
|
21
21
|
sqlframe/base/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
sqlframe/base/mixins/catalog_mixins.py,sha256=ZNzNn-cWB0RwT7L1KZCWYke2JlP-cZze0MDNOzSfHew,14093
|
|
23
|
-
sqlframe/base/mixins/readwriter_mixins.py,sha256=
|
|
23
|
+
sqlframe/base/mixins/readwriter_mixins.py,sha256=N2nsXOG3A2j6O3N195U-_fYOZMkqfifGcfduxODUcxs,4656
|
|
24
24
|
sqlframe/bigquery/__init__.py,sha256=i2NsMbiXOj2xphCtPuNk6cVw4iYeq5_B1I9dVI9aGAk,712
|
|
25
|
-
sqlframe/bigquery/catalog.py,sha256=
|
|
25
|
+
sqlframe/bigquery/catalog.py,sha256=HdRXZfZczoyLHEQ0y30nfCFKBvTTOJ1s6t0mafN_bGk,9277
|
|
26
26
|
sqlframe/bigquery/column.py,sha256=E1tUa62Y5HajkhgFuebU9zohrGyieudcHzTT8gfalio,40
|
|
27
27
|
sqlframe/bigquery/dataframe.py,sha256=fPQ6043aSS_ds30WsvrYOgNZJPH0jq7BeNHGLQ2MEW4,1372
|
|
28
28
|
sqlframe/bigquery/functions.py,sha256=RF8yG_4MS3at_60V0NNTE5ADERJZa7kZGYFWI4ST3jM,11149
|
|
29
|
-
sqlframe/bigquery/functions.pyi,sha256=doa_vkSY6OOj5_-DsYdOFJJWh1w9TIJQlAyGRkOUPA4,11929
|
|
30
29
|
sqlframe/bigquery/group.py,sha256=C3wLlyDYgNqDszTNbojoXdZQuqBYw3FRtOqpHhfaf0E,392
|
|
31
30
|
sqlframe/bigquery/readwriter.py,sha256=-r8nGOACWJ51XACONppgKsoMQMwcCgTJ0fp_mXW4JOs,871
|
|
32
|
-
sqlframe/bigquery/session.py,sha256=
|
|
31
|
+
sqlframe/bigquery/session.py,sha256=1-hE1Wr2b6SqfD4M_-OGMqjaSbhD6wSQd74v71xHZv8,2709
|
|
33
32
|
sqlframe/bigquery/types.py,sha256=KwNyuXIo-2xVVd4bZED3YrQOobKCtemlxGrJL7DrTC8,34
|
|
34
33
|
sqlframe/bigquery/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
|
35
34
|
sqlframe/duckdb/__init__.py,sha256=t85TA3ufZtL1weQNFmEs8itCSwbJFtw03-p0GT4XGf8,669
|
|
@@ -37,9 +36,8 @@ sqlframe/duckdb/catalog.py,sha256=XDFf-si0_myFBOM8rwlg2G80FdgBXBe7pkzk8xxYcuE,38
|
|
|
37
36
|
sqlframe/duckdb/column.py,sha256=wkEPcp3xVsH5nC3kpacXqNkRv9htPtBgt-0uFRxIRNs,56
|
|
38
37
|
sqlframe/duckdb/dataframe.py,sha256=9T6GV4JScaApFSA4T7fixot78HMUgkjGxU7TgjolOOM,1410
|
|
39
38
|
sqlframe/duckdb/functions.py,sha256=srvzbk_Wg-wQPFGYp624dRDyYJghi47M8E-Tu7pBdY0,1507
|
|
40
|
-
sqlframe/duckdb/functions.pyi,sha256=JXcPclyAzRbP9MK3kkRPHRIOwd0Cy1KbAv485dfxA5o,5033
|
|
41
39
|
sqlframe/duckdb/group.py,sha256=sYTExtNprfbW74LWc_Lyjc1G6K1FogQsdILU2599Bq8,384
|
|
42
|
-
sqlframe/duckdb/readwriter.py,sha256=
|
|
40
|
+
sqlframe/duckdb/readwriter.py,sha256=TC0LigUmCRpcdx4B8Mb5ap5ifFBrjmbqXmhUB5rG87U,4376
|
|
43
41
|
sqlframe/duckdb/session.py,sha256=TCAVsSqBGGj1Otb2iIkSkWqjbzzg1MeDAafGN928-O8,1893
|
|
44
42
|
sqlframe/duckdb/types.py,sha256=KwNyuXIo-2xVVd4bZED3YrQOobKCtemlxGrJL7DrTC8,34
|
|
45
43
|
sqlframe/duckdb/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
|
@@ -48,7 +46,6 @@ sqlframe/postgres/catalog.py,sha256=EjRbgHKSZKYFdKYkicIIpXiezvA0vOhAQxNyspKNxXk,
|
|
|
48
46
|
sqlframe/postgres/column.py,sha256=E1tUa62Y5HajkhgFuebU9zohrGyieudcHzTT8gfalio,40
|
|
49
47
|
sqlframe/postgres/dataframe.py,sha256=bv_y9D9w03x-sfLdippb8n4goFQGazg1j0gZEPHe98k,1372
|
|
50
48
|
sqlframe/postgres/functions.py,sha256=UNL7dE6LmzekvolwqWB-aFt8ITamxeSfuG50_NP_G8c,2133
|
|
51
|
-
sqlframe/postgres/functions.pyi,sha256=xAtohxyW6NQSucLvv1IO-dmdS9BSOdku3p93FoITyPM,4767
|
|
52
49
|
sqlframe/postgres/group.py,sha256=XmUndNdoYgy6-84xMMVCdCI06j7Na5QrSFhhqvUKcGw,392
|
|
53
50
|
sqlframe/postgres/readwriter.py,sha256=P3gXZkKKc9R92slKph5K0FPJPjsdgMYDRX-8LPsOI5s,871
|
|
54
51
|
sqlframe/postgres/session.py,sha256=oKh8-j9MN6msVheQNCYoGmej9ktFLTTHmlMP58uZ3nw,1936
|
|
@@ -94,8 +91,8 @@ sqlframe/standalone/readwriter.py,sha256=n2uoebNdL_t6_eaXNkpu7Zv2UmZ9I3rASuo01gG
|
|
|
94
91
|
sqlframe/standalone/session.py,sha256=xWxBh-OtH--LmWtpDboOBpwKLcaBK5JV-IF2gCra5k0,1192
|
|
95
92
|
sqlframe/standalone/types.py,sha256=KwNyuXIo-2xVVd4bZED3YrQOobKCtemlxGrJL7DrTC8,34
|
|
96
93
|
sqlframe/standalone/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
|
97
|
-
sqlframe-
|
|
98
|
-
sqlframe-
|
|
99
|
-
sqlframe-
|
|
100
|
-
sqlframe-
|
|
101
|
-
sqlframe-
|
|
94
|
+
sqlframe-1.1.0.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
|
95
|
+
sqlframe-1.1.0.dist-info/METADATA,sha256=RBSfrpj8FYCqz79aL88JvpDRIkKZvbASKiwT0YqwXm0,6873
|
|
96
|
+
sqlframe-1.1.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
97
|
+
sqlframe-1.1.0.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
|
98
|
+
sqlframe-1.1.0.dist-info/RECORD,,
|
sqlframe/bigquery/functions.pyi
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import typing as t
|
|
2
|
-
|
|
3
|
-
from sqlframe.base.column import Column as Column
|
|
4
|
-
from sqlframe.base.function_alternatives import (
|
|
5
|
-
array_union_using_array_concat as array_union,
|
|
6
|
-
)
|
|
7
|
-
from sqlframe.base.function_alternatives import (
|
|
8
|
-
base64_from_blob as base64,
|
|
9
|
-
)
|
|
10
|
-
from sqlframe.base.function_alternatives import (
|
|
11
|
-
bit_length_from_length as bit_length,
|
|
12
|
-
)
|
|
13
|
-
from sqlframe.base.function_alternatives import (
|
|
14
|
-
collect_set_from_list_distinct as collect_set,
|
|
15
|
-
)
|
|
16
|
-
from sqlframe.base.function_alternatives import (
|
|
17
|
-
concat_ws_from_array_to_string as concat_ws,
|
|
18
|
-
)
|
|
19
|
-
from sqlframe.base.function_alternatives import (
|
|
20
|
-
dayofmonth_from_extract_with_day as dayofmonth,
|
|
21
|
-
)
|
|
22
|
-
from sqlframe.base.function_alternatives import (
|
|
23
|
-
dayofweek_from_extract as dayofweek,
|
|
24
|
-
)
|
|
25
|
-
from sqlframe.base.function_alternatives import (
|
|
26
|
-
dayofyear_from_extract as dayofyear,
|
|
27
|
-
)
|
|
28
|
-
from sqlframe.base.function_alternatives import ( # noqa
|
|
29
|
-
e_literal as e,
|
|
30
|
-
)
|
|
31
|
-
from sqlframe.base.function_alternatives import (
|
|
32
|
-
element_at_using_brackets as element_at,
|
|
33
|
-
)
|
|
34
|
-
from sqlframe.base.function_alternatives import (
|
|
35
|
-
expm1_from_exp as expm1,
|
|
36
|
-
)
|
|
37
|
-
from sqlframe.base.function_alternatives import (
|
|
38
|
-
factorial_from_case_statement as factorial,
|
|
39
|
-
)
|
|
40
|
-
from sqlframe.base.function_alternatives import (
|
|
41
|
-
format_string_with_format as format_string,
|
|
42
|
-
)
|
|
43
|
-
from sqlframe.base.function_alternatives import (
|
|
44
|
-
hash_from_farm_fingerprint as hash,
|
|
45
|
-
)
|
|
46
|
-
from sqlframe.base.function_alternatives import (
|
|
47
|
-
hex_casted_as_bytes as hex,
|
|
48
|
-
)
|
|
49
|
-
from sqlframe.base.function_alternatives import (
|
|
50
|
-
hour_from_extract as hour,
|
|
51
|
-
)
|
|
52
|
-
from sqlframe.base.function_alternatives import (
|
|
53
|
-
instr_using_strpos as instr,
|
|
54
|
-
)
|
|
55
|
-
from sqlframe.base.function_alternatives import (
|
|
56
|
-
isnull_using_equal as isnull,
|
|
57
|
-
)
|
|
58
|
-
from sqlframe.base.function_alternatives import (
|
|
59
|
-
last_day_with_cast as last_day,
|
|
60
|
-
)
|
|
61
|
-
from sqlframe.base.function_alternatives import (
|
|
62
|
-
log1p_from_log as log1p,
|
|
63
|
-
)
|
|
64
|
-
from sqlframe.base.function_alternatives import (
|
|
65
|
-
make_date_from_date_func as make_date,
|
|
66
|
-
)
|
|
67
|
-
from sqlframe.base.function_alternatives import (
|
|
68
|
-
minute_from_extract as minute,
|
|
69
|
-
)
|
|
70
|
-
from sqlframe.base.function_alternatives import (
|
|
71
|
-
month_from_extract as month,
|
|
72
|
-
)
|
|
73
|
-
from sqlframe.base.function_alternatives import (
|
|
74
|
-
nanvl_as_case as nanvl,
|
|
75
|
-
)
|
|
76
|
-
from sqlframe.base.function_alternatives import (
|
|
77
|
-
overlay_from_substr as overlay,
|
|
78
|
-
)
|
|
79
|
-
from sqlframe.base.function_alternatives import (
|
|
80
|
-
percentile_approx_without_accuracy_and_plural as percentile_approx,
|
|
81
|
-
)
|
|
82
|
-
from sqlframe.base.function_alternatives import (
|
|
83
|
-
quarter_from_extract as quarter,
|
|
84
|
-
)
|
|
85
|
-
from sqlframe.base.function_alternatives import (
|
|
86
|
-
rand_no_seed as rand,
|
|
87
|
-
)
|
|
88
|
-
from sqlframe.base.function_alternatives import (
|
|
89
|
-
regexp_extract_only_one_group as regexp_extract,
|
|
90
|
-
)
|
|
91
|
-
from sqlframe.base.function_alternatives import (
|
|
92
|
-
rint_from_round as rint,
|
|
93
|
-
)
|
|
94
|
-
from sqlframe.base.function_alternatives import (
|
|
95
|
-
second_from_extract as second,
|
|
96
|
-
)
|
|
97
|
-
from sqlframe.base.function_alternatives import (
|
|
98
|
-
sequence_from_generate_array as sequence,
|
|
99
|
-
)
|
|
100
|
-
from sqlframe.base.function_alternatives import (
|
|
101
|
-
sha1_force_sha1_and_to_hex as sha1,
|
|
102
|
-
)
|
|
103
|
-
from sqlframe.base.function_alternatives import (
|
|
104
|
-
split_with_split as split,
|
|
105
|
-
)
|
|
106
|
-
from sqlframe.base.function_alternatives import (
|
|
107
|
-
to_date_from_timestamp as to_date,
|
|
108
|
-
)
|
|
109
|
-
from sqlframe.base.function_alternatives import (
|
|
110
|
-
weekofyear_from_extract_as_isoweek as weekofyear,
|
|
111
|
-
)
|
|
112
|
-
from sqlframe.base.function_alternatives import (
|
|
113
|
-
year_from_extract as year,
|
|
114
|
-
)
|
|
115
|
-
from sqlframe.base.functions import abs as abs
|
|
116
|
-
from sqlframe.base.functions import acos as acos
|
|
117
|
-
from sqlframe.base.functions import acosh as acosh
|
|
118
|
-
from sqlframe.base.functions import add_months as add_months
|
|
119
|
-
from sqlframe.base.functions import approx_count_distinct as approx_count_distinct
|
|
120
|
-
from sqlframe.base.functions import approxCountDistinct as approxCountDistinct
|
|
121
|
-
from sqlframe.base.functions import array as array
|
|
122
|
-
from sqlframe.base.functions import array_contains as array_contains
|
|
123
|
-
from sqlframe.base.functions import array_join as array_join
|
|
124
|
-
from sqlframe.base.functions import asc as asc
|
|
125
|
-
from sqlframe.base.functions import asc_nulls_first as asc_nulls_first
|
|
126
|
-
from sqlframe.base.functions import asc_nulls_last as asc_nulls_last
|
|
127
|
-
from sqlframe.base.functions import ascii as ascii
|
|
128
|
-
from sqlframe.base.functions import asin as asin
|
|
129
|
-
from sqlframe.base.functions import asinh as asinh
|
|
130
|
-
from sqlframe.base.functions import atan as atan
|
|
131
|
-
from sqlframe.base.functions import atan2 as atan2
|
|
132
|
-
from sqlframe.base.functions import atanh as atanh
|
|
133
|
-
from sqlframe.base.functions import avg as avg
|
|
134
|
-
from sqlframe.base.functions import bitwise_not as bitwise_not
|
|
135
|
-
from sqlframe.base.functions import bitwiseNOT as bitwiseNOT
|
|
136
|
-
from sqlframe.base.functions import cbrt as cbrt
|
|
137
|
-
from sqlframe.base.functions import ceil as ceil
|
|
138
|
-
from sqlframe.base.functions import ceiling as ceiling
|
|
139
|
-
from sqlframe.base.functions import coalesce as coalesce
|
|
140
|
-
from sqlframe.base.functions import col as col
|
|
141
|
-
from sqlframe.base.functions import collect_list as collect_list
|
|
142
|
-
from sqlframe.base.functions import concat as concat
|
|
143
|
-
from sqlframe.base.functions import corr as corr
|
|
144
|
-
from sqlframe.base.functions import cos as cos
|
|
145
|
-
from sqlframe.base.functions import cosh as cosh
|
|
146
|
-
from sqlframe.base.functions import cot as cot
|
|
147
|
-
from sqlframe.base.functions import count as count
|
|
148
|
-
from sqlframe.base.functions import covar_pop as covar_pop
|
|
149
|
-
from sqlframe.base.functions import covar_samp as covar_samp
|
|
150
|
-
from sqlframe.base.functions import csc as csc
|
|
151
|
-
from sqlframe.base.functions import cume_dist as cume_dist
|
|
152
|
-
from sqlframe.base.functions import current_date as current_date
|
|
153
|
-
from sqlframe.base.functions import current_timestamp as current_timestamp
|
|
154
|
-
from sqlframe.base.functions import date_add as date_add
|
|
155
|
-
from sqlframe.base.functions import date_diff as date_diff
|
|
156
|
-
from sqlframe.base.functions import date_format as date_format
|
|
157
|
-
from sqlframe.base.functions import date_sub as date_sub
|
|
158
|
-
from sqlframe.base.functions import date_trunc as date_trunc
|
|
159
|
-
from sqlframe.base.functions import dense_rank as dense_rank
|
|
160
|
-
from sqlframe.base.functions import desc as desc
|
|
161
|
-
from sqlframe.base.functions import desc_nulls_first as desc_nulls_first
|
|
162
|
-
from sqlframe.base.functions import desc_nulls_last as desc_nulls_last
|
|
163
|
-
from sqlframe.base.functions import exp as exp
|
|
164
|
-
from sqlframe.base.functions import explode as explode
|
|
165
|
-
from sqlframe.base.functions import explode_outer as explode_outer
|
|
166
|
-
from sqlframe.base.functions import expr as expr
|
|
167
|
-
from sqlframe.base.functions import floor as floor
|
|
168
|
-
from sqlframe.base.functions import get_json_object as get_json_object
|
|
169
|
-
from sqlframe.base.functions import greatest as greatest
|
|
170
|
-
from sqlframe.base.functions import initcap as initcap
|
|
171
|
-
from sqlframe.base.functions import input_file_name as input_file_name
|
|
172
|
-
from sqlframe.base.functions import isnan as isnan
|
|
173
|
-
from sqlframe.base.functions import lag as lag
|
|
174
|
-
from sqlframe.base.functions import lead as lead
|
|
175
|
-
from sqlframe.base.functions import least as least
|
|
176
|
-
from sqlframe.base.functions import length as length
|
|
177
|
-
from sqlframe.base.functions import lit as lit
|
|
178
|
-
from sqlframe.base.functions import log as log
|
|
179
|
-
from sqlframe.base.functions import log2 as log2
|
|
180
|
-
from sqlframe.base.functions import log10 as log10
|
|
181
|
-
from sqlframe.base.functions import lower as lower
|
|
182
|
-
from sqlframe.base.functions import lpad as lpad
|
|
183
|
-
from sqlframe.base.functions import ltrim as ltrim
|
|
184
|
-
from sqlframe.base.functions import max as max
|
|
185
|
-
from sqlframe.base.functions import max_by as max_by
|
|
186
|
-
from sqlframe.base.functions import md5 as md5
|
|
187
|
-
from sqlframe.base.functions import mean as mean
|
|
188
|
-
from sqlframe.base.functions import min as min
|
|
189
|
-
from sqlframe.base.functions import min_by as min_by
|
|
190
|
-
from sqlframe.base.functions import nth_value as nth_value
|
|
191
|
-
from sqlframe.base.functions import ntile as ntile
|
|
192
|
-
from sqlframe.base.functions import octet_length as octet_length
|
|
193
|
-
from sqlframe.base.functions import percent_rank as percent_rank
|
|
194
|
-
from sqlframe.base.functions import posexplode as posexplode
|
|
195
|
-
from sqlframe.base.functions import posexplode_outer as posexplode_outer
|
|
196
|
-
from sqlframe.base.functions import pow as pow
|
|
197
|
-
from sqlframe.base.functions import rank as rank
|
|
198
|
-
from sqlframe.base.functions import regexp_replace as regexp_replace
|
|
199
|
-
from sqlframe.base.functions import repeat as repeat
|
|
200
|
-
from sqlframe.base.functions import reverse as reverse
|
|
201
|
-
from sqlframe.base.functions import round as round
|
|
202
|
-
from sqlframe.base.functions import row_number as row_number
|
|
203
|
-
from sqlframe.base.functions import rpad as rpad
|
|
204
|
-
from sqlframe.base.functions import rtrim as rtrim
|
|
205
|
-
from sqlframe.base.functions import sec as sec
|
|
206
|
-
from sqlframe.base.functions import shiftLeft as shiftLeft
|
|
207
|
-
from sqlframe.base.functions import shiftleft as shiftleft
|
|
208
|
-
from sqlframe.base.functions import shiftRight as shiftRight
|
|
209
|
-
from sqlframe.base.functions import shiftright as shiftright
|
|
210
|
-
from sqlframe.base.functions import signum as signum
|
|
211
|
-
from sqlframe.base.functions import sin as sin
|
|
212
|
-
from sqlframe.base.functions import sinh as sinh
|
|
213
|
-
from sqlframe.base.functions import size as size
|
|
214
|
-
from sqlframe.base.functions import soundex as soundex
|
|
215
|
-
from sqlframe.base.functions import sqrt as sqrt
|
|
216
|
-
from sqlframe.base.functions import stddev as stddev
|
|
217
|
-
from sqlframe.base.functions import stddev_pop as stddev_pop
|
|
218
|
-
from sqlframe.base.functions import stddev_samp as stddev_samp
|
|
219
|
-
from sqlframe.base.functions import struct as struct
|
|
220
|
-
from sqlframe.base.functions import substring as substring
|
|
221
|
-
from sqlframe.base.functions import sum as sum
|
|
222
|
-
from sqlframe.base.functions import sum_distinct as sum_distinct
|
|
223
|
-
from sqlframe.base.functions import sumDistinct as sumDistinct
|
|
224
|
-
from sqlframe.base.functions import tan as tan
|
|
225
|
-
from sqlframe.base.functions import tanh as tanh
|
|
226
|
-
from sqlframe.base.functions import timestamp_seconds as timestamp_seconds
|
|
227
|
-
from sqlframe.base.functions import to_timestamp as to_timestamp
|
|
228
|
-
from sqlframe.base.functions import toDegrees as toDegrees
|
|
229
|
-
from sqlframe.base.functions import toRadians as toRadians
|
|
230
|
-
from sqlframe.base.functions import translate as translate
|
|
231
|
-
from sqlframe.base.functions import trim as trim
|
|
232
|
-
from sqlframe.base.functions import trunc as trunc
|
|
233
|
-
from sqlframe.base.functions import unbase64 as unbase64
|
|
234
|
-
from sqlframe.base.functions import unhex as unhex
|
|
235
|
-
from sqlframe.base.functions import upper as upper
|
|
236
|
-
from sqlframe.base.functions import var_pop as var_pop
|
|
237
|
-
from sqlframe.base.functions import var_samp as var_samp
|
|
238
|
-
from sqlframe.base.functions import variance as variance
|
|
239
|
-
from sqlframe.base.functions import when as when
|
|
240
|
-
from sqlframe.base.util import get_func_from_session as get_func_from_session
|
|
241
|
-
|
|
242
|
-
if t.TYPE_CHECKING:
|
|
243
|
-
from sqlframe.base._typing import ColumnOrLiteral, ColumnOrName
|
|
244
|
-
|
|
245
|
-
def array_distinct(col: ColumnOrName) -> Column: ...
|
|
246
|
-
def array_max(col: ColumnOrName) -> Column: ...
|
|
247
|
-
def array_min(col: ColumnOrName) -> Column: ...
|
|
248
|
-
def array_position(col: ColumnOrName, value: ColumnOrLiteral) -> Column: ...
|
|
249
|
-
def array_remove(col: ColumnOrName, value: ColumnOrLiteral) -> Column: ...
|
|
250
|
-
def array_sort(col: ColumnOrName, asc: t.Optional[bool] = ...) -> Column: ...
|
|
251
|
-
def bin(col: ColumnOrName) -> Column: ...
|
|
252
|
-
def bround(col: ColumnOrName, scale: t.Optional[int] = ...) -> Column: ...
|
|
253
|
-
def degrees(col: ColumnOrName) -> Column: ...
|
|
254
|
-
def format_number(col: ColumnOrName, d: int) -> Column: ...
|
|
255
|
-
def from_unixtime(col: ColumnOrName, format: t.Optional[str] = ...) -> Column: ...
|
|
256
|
-
def months_between(
|
|
257
|
-
date1: ColumnOrName, date2: ColumnOrName, roundOff: t.Optional[bool] = ...
|
|
258
|
-
) -> Column: ...
|
|
259
|
-
def next_day(col: ColumnOrName, dayOfWeek: str) -> Column: ...
|
|
260
|
-
def radians(col: ColumnOrName) -> Column: ...
|
|
261
|
-
def slice(
|
|
262
|
-
x: ColumnOrName, start: t.Union[ColumnOrName, int], length: t.Union[ColumnOrName, int]
|
|
263
|
-
) -> Column: ...
|
|
264
|
-
def sort_array(col: ColumnOrName, asc: t.Optional[bool] = ...) -> Column: ...
|
|
265
|
-
def substring_index(str: ColumnOrName, delim: str, count: int) -> Column: ...
|
|
266
|
-
def typeof(col: ColumnOrName) -> Column: ...
|
|
267
|
-
def unix_timestamp(
|
|
268
|
-
timestamp: t.Optional[ColumnOrName] = ..., format: t.Optional[str] = ...
|
|
269
|
-
) -> Column: ...
|
sqlframe/duckdb/functions.pyi
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
from sqlframe.base.function_alternatives import ( # noqa
|
|
2
|
-
e_literal as e,
|
|
3
|
-
expm1_from_exp as expm1,
|
|
4
|
-
log1p_from_log as log1p,
|
|
5
|
-
rint_from_round as rint,
|
|
6
|
-
kurtosis_from_kurtosis_pop as kurtosis,
|
|
7
|
-
collect_set_from_list_distinct as collect_set,
|
|
8
|
-
first_always_ignore_nulls as first,
|
|
9
|
-
factorial_ensure_int as factorial,
|
|
10
|
-
isnull_using_equal as isnull,
|
|
11
|
-
nanvl_as_case as nanvl,
|
|
12
|
-
percentile_approx_without_accuracy as percentile_approx,
|
|
13
|
-
rand_no_seed as rand,
|
|
14
|
-
base64_from_blob as base64,
|
|
15
|
-
decode_from_blob as decode,
|
|
16
|
-
format_string_with_pipes as format_string,
|
|
17
|
-
overlay_from_substr as overlay,
|
|
18
|
-
split_no_limit as split,
|
|
19
|
-
arrays_overlap_using_intersect as arrays_overlap,
|
|
20
|
-
slice_as_list_slice as slice,
|
|
21
|
-
array_join_null_replacement_with_transform as array_join,
|
|
22
|
-
element_at_using_brackets as element_at,
|
|
23
|
-
array_remove_using_filter as array_remove,
|
|
24
|
-
array_union_using_list_concat as array_union,
|
|
25
|
-
array_min_from_sort as array_min,
|
|
26
|
-
array_max_from_sort as array_max,
|
|
27
|
-
sequence_from_generate_series as sequence,
|
|
28
|
-
)
|
|
29
|
-
from sqlframe.base.functions import (
|
|
30
|
-
abs as abs,
|
|
31
|
-
acos as acos,
|
|
32
|
-
add_months as add_months,
|
|
33
|
-
approxCountDistinct as approxCountDistinct,
|
|
34
|
-
approx_count_distinct as approx_count_distinct,
|
|
35
|
-
array as array,
|
|
36
|
-
array_contains as array_contains,
|
|
37
|
-
array_distinct as array_distinct,
|
|
38
|
-
array_intersect as array_intersect,
|
|
39
|
-
array_position as array_position,
|
|
40
|
-
array_sort as array_sort,
|
|
41
|
-
asc as asc,
|
|
42
|
-
asc_nulls_first as asc_nulls_first,
|
|
43
|
-
asc_nulls_last as asc_nulls_last,
|
|
44
|
-
ascii as ascii,
|
|
45
|
-
asin as asin,
|
|
46
|
-
atan as atan,
|
|
47
|
-
atan2 as atan2,
|
|
48
|
-
avg as avg,
|
|
49
|
-
bin as bin,
|
|
50
|
-
bit_length as bit_length,
|
|
51
|
-
bitwiseNOT as bitwiseNOT,
|
|
52
|
-
bitwise_not as bitwise_not,
|
|
53
|
-
cbrt as cbrt,
|
|
54
|
-
ceil as ceil,
|
|
55
|
-
ceiling as ceiling,
|
|
56
|
-
coalesce as coalesce,
|
|
57
|
-
col as col,
|
|
58
|
-
collect_list as collect_list,
|
|
59
|
-
concat as concat,
|
|
60
|
-
concat_ws as concat_ws,
|
|
61
|
-
corr as corr,
|
|
62
|
-
cos as cos,
|
|
63
|
-
cot as cot,
|
|
64
|
-
count as count,
|
|
65
|
-
countDistinct as countDistinct,
|
|
66
|
-
count_distinct as count_distinct,
|
|
67
|
-
covar_pop as covar_pop,
|
|
68
|
-
covar_samp as covar_samp,
|
|
69
|
-
create_map as create_map,
|
|
70
|
-
cume_dist as cume_dist,
|
|
71
|
-
current_date as current_date,
|
|
72
|
-
current_timestamp as current_timestamp,
|
|
73
|
-
date_add as date_add,
|
|
74
|
-
date_diff as date_diff,
|
|
75
|
-
date_format as date_format,
|
|
76
|
-
date_sub as date_sub,
|
|
77
|
-
date_trunc as date_trunc,
|
|
78
|
-
dayofmonth as dayofmonth,
|
|
79
|
-
dayofweek as dayofweek,
|
|
80
|
-
dayofyear as dayofyear,
|
|
81
|
-
degrees as degrees,
|
|
82
|
-
dense_rank as dense_rank,
|
|
83
|
-
desc as desc,
|
|
84
|
-
desc_nulls_first as desc_nulls_first,
|
|
85
|
-
desc_nulls_last as desc_nulls_last,
|
|
86
|
-
encode as encode,
|
|
87
|
-
exp as exp,
|
|
88
|
-
explode as explode,
|
|
89
|
-
expr as expr,
|
|
90
|
-
flatten as flatten,
|
|
91
|
-
floor as floor,
|
|
92
|
-
from_unixtime as from_unixtime,
|
|
93
|
-
get_json_object as get_json_object,
|
|
94
|
-
greatest as greatest,
|
|
95
|
-
grouping_id as grouping_id,
|
|
96
|
-
hash as hash,
|
|
97
|
-
hex as hex,
|
|
98
|
-
hour as hour,
|
|
99
|
-
input_file_name as input_file_name,
|
|
100
|
-
instr as instr,
|
|
101
|
-
isnan as isnan,
|
|
102
|
-
lag as lag,
|
|
103
|
-
last as last,
|
|
104
|
-
lead as lead,
|
|
105
|
-
least as least,
|
|
106
|
-
length as length,
|
|
107
|
-
levenshtein as levenshtein,
|
|
108
|
-
lit as lit,
|
|
109
|
-
locate as locate,
|
|
110
|
-
log as log,
|
|
111
|
-
log10 as log10,
|
|
112
|
-
log2 as log2,
|
|
113
|
-
lower as lower,
|
|
114
|
-
lpad as lpad,
|
|
115
|
-
ltrim as ltrim,
|
|
116
|
-
make_date as make_date,
|
|
117
|
-
map_from_arrays as map_from_arrays,
|
|
118
|
-
max as max,
|
|
119
|
-
max_by as max_by,
|
|
120
|
-
md5 as md5,
|
|
121
|
-
mean as mean,
|
|
122
|
-
min as min,
|
|
123
|
-
min_by as min_by,
|
|
124
|
-
minute as minute,
|
|
125
|
-
month as month,
|
|
126
|
-
months_between as months_between,
|
|
127
|
-
nth_value as nth_value,
|
|
128
|
-
ntile as ntile,
|
|
129
|
-
percent_rank as percent_rank,
|
|
130
|
-
percentile as percentile,
|
|
131
|
-
pow as pow,
|
|
132
|
-
quarter as quarter,
|
|
133
|
-
radians as radians,
|
|
134
|
-
rank as rank,
|
|
135
|
-
regexp_extract as regexp_extract,
|
|
136
|
-
regexp_replace as regexp_replace,
|
|
137
|
-
repeat as repeat,
|
|
138
|
-
reverse as reverse,
|
|
139
|
-
round as round,
|
|
140
|
-
row_number as row_number,
|
|
141
|
-
rpad as rpad,
|
|
142
|
-
rtrim as rtrim,
|
|
143
|
-
second as second,
|
|
144
|
-
shiftLeft as shiftLeft,
|
|
145
|
-
shiftRight as shiftRight,
|
|
146
|
-
shiftleft as shiftleft,
|
|
147
|
-
shiftright as shiftright,
|
|
148
|
-
signum as signum,
|
|
149
|
-
sin as sin,
|
|
150
|
-
size as size,
|
|
151
|
-
skewness as skewness,
|
|
152
|
-
sort_array as sort_array,
|
|
153
|
-
soundex as soundex,
|
|
154
|
-
sqrt as sqrt,
|
|
155
|
-
stddev as stddev,
|
|
156
|
-
stddev_pop as stddev_pop,
|
|
157
|
-
stddev_samp as stddev_samp,
|
|
158
|
-
struct as struct,
|
|
159
|
-
substring as substring,
|
|
160
|
-
sum as sum,
|
|
161
|
-
sumDistinct as sumDistinct,
|
|
162
|
-
sum_distinct as sum_distinct,
|
|
163
|
-
tan as tan,
|
|
164
|
-
timestamp_seconds as timestamp_seconds,
|
|
165
|
-
toDegrees as toDegrees,
|
|
166
|
-
toRadians as toRadians,
|
|
167
|
-
to_date as to_date,
|
|
168
|
-
to_timestamp as to_timestamp,
|
|
169
|
-
translate as translate,
|
|
170
|
-
trim as trim,
|
|
171
|
-
trunc as trunc,
|
|
172
|
-
typeof as typeof,
|
|
173
|
-
unbase64 as unbase64,
|
|
174
|
-
unhex as unhex,
|
|
175
|
-
unix_timestamp as unix_timestamp,
|
|
176
|
-
upper as upper,
|
|
177
|
-
var_pop as var_pop,
|
|
178
|
-
var_samp as var_samp,
|
|
179
|
-
variance as variance,
|
|
180
|
-
weekofyear as weekofyear,
|
|
181
|
-
when as when,
|
|
182
|
-
year as year,
|
|
183
|
-
)
|
sqlframe/postgres/functions.pyi
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
from sqlframe.base.function_alternatives import ( # noqa
|
|
2
|
-
e_literal as e,
|
|
3
|
-
expm1_from_exp as expm1,
|
|
4
|
-
log1p_from_log as log1p,
|
|
5
|
-
rint_from_round as rint,
|
|
6
|
-
collect_set_from_list_distinct as collect_set,
|
|
7
|
-
isnan_using_equal as isnan,
|
|
8
|
-
isnull_using_equal as isnull,
|
|
9
|
-
nanvl_as_case as nanvl,
|
|
10
|
-
rand_no_seed as rand,
|
|
11
|
-
round_cast_as_numeric as round,
|
|
12
|
-
year_from_extract as year,
|
|
13
|
-
quarter_from_extract as quarter,
|
|
14
|
-
month_from_extract as month,
|
|
15
|
-
dayofweek_from_extract_with_isodow as dayofweek,
|
|
16
|
-
dayofmonth_from_extract_with_day as dayofmonth,
|
|
17
|
-
dayofyear_from_extract_doy as dayofyear,
|
|
18
|
-
hour_from_extract as hour,
|
|
19
|
-
minute_from_extract as minute,
|
|
20
|
-
second_from_extract as second,
|
|
21
|
-
weekofyear_from_extract_as_week as weekofyear,
|
|
22
|
-
make_date_casted_as_integer as make_date,
|
|
23
|
-
date_add_by_multiplication as date_add,
|
|
24
|
-
date_sub_by_multiplication as date_sub,
|
|
25
|
-
date_diff_with_subtraction as date_diff,
|
|
26
|
-
add_months_by_multiplication as add_months,
|
|
27
|
-
months_between_from_age_and_extract as months_between,
|
|
28
|
-
from_unixtime_from_timestamp as from_unixtime,
|
|
29
|
-
unix_timestamp_from_extract as unix_timestamp,
|
|
30
|
-
base64_from_blob as base64,
|
|
31
|
-
bas64_from_encode as base64,
|
|
32
|
-
unbase64_from_decode as unbase64,
|
|
33
|
-
decode_from_convert_from as decode,
|
|
34
|
-
encode_from_convert_to as encode,
|
|
35
|
-
format_number_from_to_char as format_number,
|
|
36
|
-
format_string_with_format as format_string,
|
|
37
|
-
split_from_regex_split_to_array as split,
|
|
38
|
-
array_contains_any as array_contains,
|
|
39
|
-
slice_with_brackets as slice,
|
|
40
|
-
element_at_using_brackets as element_at,
|
|
41
|
-
get_json_object_using_arrow_op as get_json_object,
|
|
42
|
-
array_min_from_subquery as array_min,
|
|
43
|
-
array_max_from_subquery as array_max,
|
|
44
|
-
)
|
|
45
|
-
from sqlframe.base.functions import (
|
|
46
|
-
abs as abs,
|
|
47
|
-
acos as acos,
|
|
48
|
-
acosh as acosh,
|
|
49
|
-
array as array,
|
|
50
|
-
array_join as array_join,
|
|
51
|
-
array_position as array_position,
|
|
52
|
-
array_remove as array_remove,
|
|
53
|
-
arrays_overlap as arrays_overlap,
|
|
54
|
-
asc as asc,
|
|
55
|
-
asc_nulls_first as asc_nulls_first,
|
|
56
|
-
asc_nulls_last as asc_nulls_last,
|
|
57
|
-
ascii as ascii,
|
|
58
|
-
asin as asin,
|
|
59
|
-
asinh as asinh,
|
|
60
|
-
atan as atan,
|
|
61
|
-
atan2 as atan2,
|
|
62
|
-
atanh as atanh,
|
|
63
|
-
avg as avg,
|
|
64
|
-
bit_length as bit_length,
|
|
65
|
-
bitwiseNOT as bitwiseNOT,
|
|
66
|
-
bitwise_not as bitwise_not,
|
|
67
|
-
cbrt as cbrt,
|
|
68
|
-
ceil as ceil,
|
|
69
|
-
ceiling as ceiling,
|
|
70
|
-
coalesce as coalesce,
|
|
71
|
-
col as col,
|
|
72
|
-
collect_list as collect_list,
|
|
73
|
-
concat as concat,
|
|
74
|
-
concat_ws as concat_ws,
|
|
75
|
-
corr as corr,
|
|
76
|
-
cos as cos,
|
|
77
|
-
cosh as cosh,
|
|
78
|
-
cot as cot,
|
|
79
|
-
count as count,
|
|
80
|
-
countDistinct as countDistinct,
|
|
81
|
-
count_distinct as count_distinct,
|
|
82
|
-
covar_pop as covar_pop,
|
|
83
|
-
covar_samp as covar_samp,
|
|
84
|
-
cume_dist as cume_dist,
|
|
85
|
-
current_date as current_date,
|
|
86
|
-
current_timestamp as current_timestamp,
|
|
87
|
-
date_format as date_format,
|
|
88
|
-
date_trunc as date_trunc,
|
|
89
|
-
degrees as degrees,
|
|
90
|
-
dense_rank as dense_rank,
|
|
91
|
-
desc as desc,
|
|
92
|
-
desc_nulls_first as desc_nulls_first,
|
|
93
|
-
desc_nulls_last as desc_nulls_last,
|
|
94
|
-
exp as exp,
|
|
95
|
-
explode as explode,
|
|
96
|
-
expr as expr,
|
|
97
|
-
factorial as factorial,
|
|
98
|
-
floor as floor,
|
|
99
|
-
greatest as greatest,
|
|
100
|
-
initcap as initcap,
|
|
101
|
-
input_file_name as input_file_name,
|
|
102
|
-
instr as instr,
|
|
103
|
-
lag as lag,
|
|
104
|
-
lead as lead,
|
|
105
|
-
least as least,
|
|
106
|
-
length as length,
|
|
107
|
-
levenshtein as levenshtein,
|
|
108
|
-
lit as lit,
|
|
109
|
-
locate as locate,
|
|
110
|
-
log as log,
|
|
111
|
-
log10 as log10,
|
|
112
|
-
log2 as log2,
|
|
113
|
-
lower as lower,
|
|
114
|
-
lpad as lpad,
|
|
115
|
-
ltrim as ltrim,
|
|
116
|
-
max as max,
|
|
117
|
-
md5 as md5,
|
|
118
|
-
mean as mean,
|
|
119
|
-
min as min,
|
|
120
|
-
nth_value as nth_value,
|
|
121
|
-
ntile as ntile,
|
|
122
|
-
octet_length as octet_length,
|
|
123
|
-
overlay as overlay,
|
|
124
|
-
percent_rank as percent_rank,
|
|
125
|
-
percentile as percentile,
|
|
126
|
-
pow as pow,
|
|
127
|
-
radians as radians,
|
|
128
|
-
rank as rank,
|
|
129
|
-
regexp_replace as regexp_replace,
|
|
130
|
-
repeat as repeat,
|
|
131
|
-
reverse as reverse,
|
|
132
|
-
row_number as row_number,
|
|
133
|
-
rpad as rpad,
|
|
134
|
-
rtrim as rtrim,
|
|
135
|
-
shiftLeft as shiftLeft,
|
|
136
|
-
shiftRight as shiftRight,
|
|
137
|
-
shiftleft as shiftleft,
|
|
138
|
-
shiftright as shiftright,
|
|
139
|
-
signum as signum,
|
|
140
|
-
sin as sin,
|
|
141
|
-
sinh as sinh,
|
|
142
|
-
size as size,
|
|
143
|
-
soundex as soundex,
|
|
144
|
-
sqrt as sqrt,
|
|
145
|
-
stddev as stddev,
|
|
146
|
-
stddev_pop as stddev_pop,
|
|
147
|
-
stddev_samp as stddev_samp,
|
|
148
|
-
substring as substring,
|
|
149
|
-
sum as sum,
|
|
150
|
-
sumDistinct as sumDistinct,
|
|
151
|
-
sum_distinct as sum_distinct,
|
|
152
|
-
tan as tan,
|
|
153
|
-
tanh as tanh,
|
|
154
|
-
timestamp_seconds as timestamp_seconds,
|
|
155
|
-
toDegrees as toDegrees,
|
|
156
|
-
toRadians as toRadians,
|
|
157
|
-
to_date as to_date,
|
|
158
|
-
to_timestamp as to_timestamp,
|
|
159
|
-
translate as translate,
|
|
160
|
-
trim as trim,
|
|
161
|
-
trunc as trunc,
|
|
162
|
-
upper as upper,
|
|
163
|
-
var_pop as var_pop,
|
|
164
|
-
var_samp as var_samp,
|
|
165
|
-
variance as variance,
|
|
166
|
-
when as when,
|
|
167
|
-
)
|
|
File without changes
|
|
File without changes
|