Skip to content

Commit

Permalink
Addressing quality
Browse files Browse the repository at this point in the history
  • Loading branch information
naswierczek committed Mar 15, 2024
1 parent 115661e commit 159a625
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 1 addition & 3 deletions records_mover/records/job/mover.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Create and run jobs to convert between different sources and targets"""
import sys

from records_mover import Session
from ..processing_instructions import ProcessingInstructions
from ..results import MoveResult
Expand Down Expand Up @@ -43,7 +41,7 @@ def run_records_mover_job(source_method_name: str,
else:
run_legacy = True
except NotImplementedError as e:
logger.warning(f"""WARNING: This type of move not yet supported in air byte engine.
logger.warning(f"""WARNING: This type of move not yet supported in air byte engine.
Falling back to legacy engine. Message: {e}""")
run_legacy = True
if run_legacy:
Expand Down
16 changes: 9 additions & 7 deletions records_mover/records/mover.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ def move(records_source: RecordsSource,
# See documentation for RecordsSource in sources.py and
# RecordsTarget in targets.py for the semantics of the methods
# being called.
if (isinstance(records_source, sources_base.SupportsRecordsDirectory) and
isinstance(records_target, SupportsMoveFromRecordsDirectory) and
records_target.
can_move_directly_from_scheme(records_source.records_directory().loc.scheme) and
records_target.can_move_from_format(records_source.records_format)):
if (isinstance(records_source, sources_base.SupportsRecordsDirectory)
and isinstance(records_target, SupportsMoveFromRecordsDirectory)
and records_target.can_move_directly_from_scheme(
records_source.records_directory().loc.scheme
)
and records_target.can_move_from_format(records_source.records_format)):
# Tell the destination to load directly from wherever the
# source is, without needing to make any copies of the data or
# streaming it through the current box.
Expand Down Expand Up @@ -140,8 +141,9 @@ def move(records_source: RecordsSource,
elif (isinstance(records_source, SupportsMoveToRecordsDirectory) and
isinstance(records_target, MightSupportMoveFromTempLocAfterFillingIt) and
records_source.has_compatible_format(records_target) and
records_source.
can_move_to_scheme(records_target.temporary_loadable_directory_scheme()) and
records_source.can_move_to_scheme(
records_target.temporary_loadable_directory_scheme()
) and
records_target.can_move_from_temp_loc_after_filling_it()):
logger.info(f"Mover: copying from {records_source} to {records_target} "
f"by filling in a temporary location...")
Expand Down
2 changes: 1 addition & 1 deletion records_mover/records/sources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ class SupportsAirbyte(RecordsSource, metaclass=ABCMeta):
@abstractmethod
@contextmanager
def not_sure_yet(self) -> Iterator['FileobjsSource']:
yield FileobjsSource()
yield FileobjsSource()

0 comments on commit 159a625

Please sign in to comment.