Skip to content

Commit 4b4cfa2

Browse files
committed
reformat rebuild
1 parent d375744 commit 4b4cfa2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+805
-502
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ can perform data engineering in [`Pandas`](https://pandas.pydata.org) and genera
1515
Install `data_algebra` with either of:
1616

1717
* `pip install data_algebra`
18-
* `pip install https://github.com/WinVector/data_algebra/raw/master/dist/data_algebra-0.1.8.tar.gz`
18+
* `pip install https://github.com/WinVector/data_algebra/raw/master/dist/data_algebra-0.1.9.tar.gz`
1919

2020
# Announcement
2121

build/lib/data_algebra/SparkSQL.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SparkSQLModel(data_algebra.db_model.DBModel):
1212
def __init__(self):
1313
data_algebra.db_model.DBModel.__init__(
1414
self,
15-
identifier_quote='`',
15+
identifier_quote="`",
1616
string_quote='"',
1717
sql_formatters=SparkSQL_formatters,
1818
)

build/lib/data_algebra/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858

5959
__docformat__ = "restructuredtext"
60-
__version__ = "0.1.8"
60+
__version__ = "0.1.9"
6161

6262
__doc__ = """
6363
`data_algebra`<https://github.com/WinVector/data_algebra> is a piped data wrangling system

build/lib/data_algebra/cdata.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ def table_is_keyed_by_columns(table, column_names):
2929

3030

3131
class RecordSpecification:
32-
def __init__(self, control_table, *,
33-
record_keys=None, control_table_keys=None, strict=False):
32+
def __init__(
33+
self, control_table, *, record_keys=None, control_table_keys=None, strict=False
34+
):
3435
control_table = data_algebra.data_types.convert_to_pandas_dataframe(
3536
control_table, "control_table"
3637
)
@@ -50,14 +51,18 @@ def __init__(self, control_table, *,
5051
self.control_table_keys = [k for k in control_table_keys]
5152
unknown = set(self.control_table_keys) - set(control_table.columns)
5253
if len(unknown) > 0:
53-
raise ValueError("control table keys that are not in the control table: " + str(unknown))
54+
raise ValueError(
55+
"control table keys that are not in the control table: " + str(unknown)
56+
)
5457
confused = set(record_keys).intersection(control_table_keys)
5558
if len(confused) > 0:
5659
raise ValueError(
5760
"columns common to record_keys and control_table_keys: " + str(confused)
5861
)
5962
if strict:
60-
if not table_is_keyed_by_columns(self.control_table, self.control_table_keys):
63+
if not table_is_keyed_by_columns(
64+
self.control_table, self.control_table_keys
65+
):
6166
raise ValueError("control table wasn't keyed by control table keys")
6267
self.block_columns = self.record_keys + [c for c in self.control_table.columns]
6368
cvs = []

build/lib/data_algebra/cdata_impl.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ def __init__(self, *, blocks_in=None, blocks_out=None, strict=False):
3434
raise ValueError("unknown outgoing content_keys" + str(unknown))
3535
if strict:
3636
if set(blocks_in.record_keys) != set(blocks_out.record_keys):
37-
raise ValueError("record keys must match when using both blocks in and blocks out")
37+
raise ValueError(
38+
"record keys must match when using both blocks in and blocks out"
39+
)
3840
if set(blocks_in.content_keys) != set(blocks_out.content_keys):
39-
raise ValueError("content keys must match when using both blocks in and blocks out")
41+
raise ValueError(
42+
"content keys must match when using both blocks in and blocks out"
43+
)
4044
self.blocks_in = blocks_in
4145
self.blocks_out = blocks_out
4246
if self.blocks_in is not None:
@@ -113,7 +117,9 @@ def transform(
113117
raise KeyError("missing required columns: " + str(missing_cols))
114118
if check_blocks_out_keying:
115119
# table should be keyed by record_keys
116-
if not data_algebra.cdata.table_is_keyed_by_columns(X, self.blocks_out.record_keys):
120+
if not data_algebra.cdata.table_is_keyed_by_columns(
121+
X, self.blocks_out.record_keys
122+
):
117123
raise ValueError("table is not keyed by blocks_out.record_keys")
118124
# convert to block records
119125
with sqlite3.connect(":memory:") as conn:
@@ -159,24 +165,30 @@ def compose(self, other):
159165
blocks_out=data_algebra.cdata.RecordSpecification(
160166
control_table=rso,
161167
record_keys=rk,
162-
control_table_keys=s2.blocks_out.control_table_keys))
168+
control_table_keys=s2.blocks_out.control_table_keys,
169+
)
170+
)
163171
else:
164172
if out.shape[0] < 2:
165173
return RecordMap(
166174
blocks_in=data_algebra.cdata.RecordSpecification(
167175
control_table=rsi,
168176
record_keys=rk,
169-
control_table_keys=s1.blocks_in.control_table_keys))
177+
control_table_keys=s1.blocks_in.control_table_keys,
178+
)
179+
)
170180
else:
171181
return RecordMap(
172182
blocks_in=data_algebra.cdata.RecordSpecification(
173183
control_table=rsi,
174184
record_keys=rk,
175-
control_table_keys=s1.blocks_in.control_table_keys),
185+
control_table_keys=s1.blocks_in.control_table_keys,
186+
),
176187
blocks_out=data_algebra.cdata.RecordSpecification(
177188
control_table=rso,
178189
record_keys=rk,
179-
control_table_keys=s2.blocks_out.control_table_keys)
190+
control_table_keys=s2.blocks_out.control_table_keys,
191+
),
180192
)
181193

182194
def __rrshift__(self, other): # override other >> self

build/lib/data_algebra/dask_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import data_algebra
32
import data_algebra.data_ops
43
import data_algebra.pandas_model

0 commit comments

Comments
 (0)