Skip to content

Commit

Permalink
remove stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ccl-core committed Sep 23, 2024
1 parent 6c05d10 commit 4da67de
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,28 @@ def call(self, *args: pd.Series) -> pd.Series | None:
"""See class' docstring."""
if len(args) == 1:
return args[0]

print("DEBUG: those are the pandas df")
for a in args:
print("DEBUG: a=\n", a, "\n--------")
predecessors: list[str | None] = [
operation.node.uuid for operation in self.operations.predecessors(self)
]
print("DEBUG: predecessors are: ", predecessors)
if len(predecessors) != len(args):
raise ValueError(f"Unsupported: Trying to join {len(args)} pd.DataFrames.")
fields = self.node.fields
print("DEBUG: fields are: ", fields)
# `joins` is the list of joins: field x (source1, df1) x (source2, df2)
joins: list[
tuple[Field, tuple[Source, pd.Series], tuple[Source, pd.Series]]
] = []
for field in fields:
left = field.source
right = field.references
print("DEBUG: field is: ", field, "\n with left: ", left, "\n and right:", right)
if left is None or right is None:
continue
if left.uuid is None or right.uuid is None:
continue
left_index = predecessors.index(get_parent_uuid(self.node.ctx, left.uuid))
right_index = predecessors.index(get_parent_uuid(self.node.ctx, right.uuid))
join = (field, (left, args[left_index]), (right, args[right_index]))
print("and right_index:", right_index, "\nand left index: ", left_index, " and join: ", join)
if join not in joins:
joins.append(join)
print("DEBUG: joins are: ", joins)
for field, (left, df_left), (right, df_right) in joins:
assert left is not None and left.uuid is not None, (
f'Left reference for "{field.uuid}" is None. It should be a valid'
Expand All @@ -64,7 +55,6 @@ def call(self, *args: pd.Series) -> pd.Series | None:
)
left_column = left.get_column()
right_column = right.get_column()
print("DEBUG: left column is: ", left_column, " and df_left.columns is: ", df_left.columns)
assert left_column in df_left.columns, (
f'Column "{left_column}" does not exist in node "{left.uuid}".'
f" Existing columns: {df_left.columns}"
Expand Down

0 comments on commit 4da67de

Please sign in to comment.