Skip to content

Commit

Permalink
update multimethod
Browse files Browse the repository at this point in the history
Signed-off-by: Koudai Yamasaki <[email protected]>
  • Loading branch information
ymski committed Jan 9, 2025
1 parent 3ffd706 commit 002be4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
18 changes: 5 additions & 13 deletions src/caret_analyze/infra/trace_point_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,21 +303,10 @@ def merge(self, arg) -> None:
raise NotImplementedError('')

@merge.register
def _merge_single_join_key(
def _merge(
self,
other: TracePointData,
on: str,
how='inner',
*,
drop_columns: list[str] | None = None
) -> None:
self._merge_impl(other, on, how, drop_columns=drop_columns)

@merge.register
def _merge_multiple_join_key(
self,
other: TracePointData,
on: list[str],
on: str | list[str],
how='inner',
*,
drop_columns: list[str] | None = None
Expand All @@ -332,6 +321,9 @@ def _merge_impl(
*,
drop_columns: list[str] | None = None
) -> None:

print(f'on: {on}')
print(f'other: {other}')
"""
Merge TracePointData.
Expand Down
6 changes: 1 addition & 5 deletions src/caret_analyze/record/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,9 @@ def append(self, arg):
raise InvalidArgumentError(f'Unknown argument type: {arg}')

@append.register
def __append_record(self, other: RecordInterface) -> None:
def __append_record(self, other: RecordInterface | RecordBase) -> None:
self._append_record(other)

@append.register
def __append_record_base(self, other: RecordBase) -> None:
self._append_record(other) # type: ignore

@abstractmethod
def _append_record(self, other: RecordInterface) -> None:
"""
Expand Down

0 comments on commit 002be4f

Please sign in to comment.