Skip to content

Commit

Permalink
Add support for wildcard import files in manifest.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaits committed Jan 23, 2025
1 parent 08052bf commit ab77559
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions import-automation/executor/app/executor/import_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
sys.path.append(os.path.join(REPO_DIR, 'tools', 'import_differ'))
sys.path.append(os.path.join(REPO_DIR, 'tools', 'import_validation'))
sys.path.append(os.path.join(REPO_DIR, 'util'))

import file_util

from import_differ import ImportDiffer
from import_validation import ImportValidation
Expand Down Expand Up @@ -536,13 +539,18 @@ def _upload_import_inputs(
for import_input in import_inputs:
for input_type in self.config.import_input_types:
path = import_input.get(input_type)
if path:
dest = f'{output_dir}/{version}/{os.path.basename(path)}'
self._upload_file_helper(
src=os.path.join(import_dir, path),
dest=dest,
)
setattr(uploaded, input_type, dest)
if not path:
continue
for file in file_util.file_get_matching(
os.path.join(import_dir, path)):
if file:
dest = f'{output_dir}/{version}/{os.path.basename(file)}'
self._upload_file_helper(
src=file,
dest=dest,
)
uploaded_dest = f'{output_dir}/{version}/{os.path.basename(path)}'
setattr(uploaded, input_type, uploaded_dest)
self.uploader.upload_string(
version,
os.path.join(output_dir, self.config.storage_version_filename))
Expand All @@ -565,7 +573,7 @@ def _import_metadata_mcf_helper(self, import_spec: dict) -> str:
Args:
import_spec: Specification of the import as a dict.
Returns:
import_metadata_mcf node.
"""
Expand Down

0 comments on commit ab77559

Please sign in to comment.