Skip to content

Commit eea51a9

Browse files
committed
rebuild
1 parent ec67599 commit eea51a9

31 files changed

+1145
-553
lines changed

build/lib/data_algebra/PolarsSQL.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def _polars_null_divide_expr(dbmodel, expression):
2929

3030

3131
class PolarsSQLModel(data_algebra.sql_model.SQLModel):
32-
"""A model of how SQL should be generated for PolarsSQL.
32+
"""
33+
A model of how SQL should be generated for PolarsSQL.
34+
Model is just a stand-in for now, as we don't have a good description of Polars SQL dialect yet.
3335
"""
3436

3537
def __init__(self):

build/lib/data_algebra/SQLite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
# map from op-name to special SQL formatting code
2424

25+
2526
# Standard SQL code for checking isbad doesn't work in SQLlite, so
2627
# at least capture to is_bad, which appears to not be implemented
2728
# unless we call prepare connection
@@ -83,6 +84,7 @@ def _sqlite_remainder_expr(dbmodel, expression):
8384
+ ")"
8485
)
8586

87+
8688
def _sqlite_logical_or_expr(dbmodel, expression):
8789
"""
8890
Return SQL or.

build/lib/data_algebra/SparkSQL.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def _as_int(dbmodel, expression):
118118
+ " AS INT)"
119119
)
120120

121+
121122
# map from op-name to special SQL formatting code
122123
SparkSQL_formatters = {
123124
"___": lambda dbmodel, expression: str(expression.to_python()),

build/lib/data_algebra/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,19 @@
1818

1919
import data_algebra.data_model
2020
import data_algebra.data_ops
21+
2122
# import for easy access for package users
22-
from data_algebra.data_ops import TableDescription, SQLNode, describe_table, descr, data, ex
23+
from data_algebra.data_ops import (
24+
TableDescription,
25+
SQLNode,
26+
describe_table,
27+
descr,
28+
data,
29+
ex,
30+
)
2331
from data_algebra.expr_rep import lit, col, d_, one
2432
import data_algebra.pandas_model
33+
import data_algebra.data_schema
34+
2535

2636
data_algebra.pandas_model.register_pandas_model()

build/lib/data_algebra/arrow.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ class DataOpArrow(Arrow):
4141
4242
"""
4343

44-
def __init__(
45-
self, pipeline, *, free_table_key=None
46-
):
44+
def __init__(self, pipeline, *, free_table_key=None):
4745
assert isinstance(pipeline, data_algebra.data_ops.ViewRepresentation)
4846
self.pipeline = pipeline
4947
t_used = pipeline.get_tables()
@@ -71,7 +69,7 @@ def get_feature_names(self):
7169
def act_on(self, b, *, correct_ordered_first_call: bool = False):
7270
"""
7371
Apply self onto b.
74-
72+
7573
:param b: item to act on, or item that has been sent to self.
7674
:param correct_ordered_first_call: if True indicates this call is from __rshift__ or __rrshift__ and not the fallback paths.
7775
"""
@@ -86,7 +84,9 @@ def act_on(self, b, *, correct_ordered_first_call: bool = False):
8684
excess = set(b.outgoing_columns) - set(self.incoming_columns)
8785
if len(excess) > 0:
8886
raise ValueError("extra incoming columns: " + str(excess))
89-
new_pipeline = self.pipeline.replace_leaves({self.free_table_key: b.pipeline})
87+
new_pipeline = self.pipeline.replace_leaves(
88+
{self.free_table_key: b.pipeline}
89+
)
9090
new_pipeline.get_tables() # check tables are compatible
9191
res = DataOpArrow(
9292
pipeline=new_pipeline,
@@ -148,9 +148,7 @@ def required_columns(self):
148148
return self.incoming_columns.copy()
149149

150150
# noinspection PyMethodMayBeStatic
151-
def format_end_description(
152-
self, *, required_cols, align_right=70, sep_width=2
153-
):
151+
def format_end_description(self, *, required_cols, align_right=70, sep_width=2):
154152
in_rep = [str(c) for c in required_cols]
155153
in_rep = data_algebra.flow_text.flow_text(
156154
in_rep, align_right=align_right, sep_width=sep_width

0 commit comments

Comments
 (0)