diff --git a/sdlf-datalakeLibrary/python/datalake_library/octagon/client.py b/sdlf-datalakeLibrary/python/datalake_library/octagon/client.py index 40a24781..394b711d 100755 --- a/sdlf-datalakeLibrary/python/datalake_library/octagon/client.py +++ b/sdlf-datalakeLibrary/python/datalake_library/octagon/client.py @@ -1,8 +1,8 @@ +import importlib.resources import logging import os import boto3 -import pkg_resources from .artifact import Artifact, ArtifactAPI from .config import ConfigParser @@ -17,9 +17,9 @@ def __init__(self): self.logger = logging.getLogger(__name__) self.region = "us-east-1" self.profile = "default" - self.configuration_file = pkg_resources.resource_filename(__name__, "octagon-configuration.json") + self.configuration_file = importlib.resources.files(__name__) / "octagon-configuration.json" self.configuration_instance = "dev" - self.metadata_file = pkg_resources.resource_filename(__name__, "octagon-metadata.json") + self.metadata_file = importlib.resources.files(__name__) / "octagon-metadata.json" self.initialized = False self.run_in_fargate = False self.run_in_lambda = False diff --git a/sdlf-datalakeLibrary/python/datalake_library/octagon/utils.py b/sdlf-datalakeLibrary/python/datalake_library/octagon/utils.py index efdaff20..e65ed73d 100755 --- a/sdlf-datalakeLibrary/python/datalake_library/octagon/utils.py +++ b/sdlf-datalakeLibrary/python/datalake_library/octagon/utils.py @@ -4,15 +4,15 @@ def get_duration_sec(start_timestamp_str, end_timestamp_str): - ts_format = "%Y-%m-%dT%H:%M:%S.%f" - start_ts = datetime.datetime.strptime(start_timestamp_str[:-1], ts_format) - end_ts = datetime.datetime.strptime(end_timestamp_str[:-1], ts_format) + ts_format = "%Y-%m-%dT%H:%M:%S.%f%z" + start_ts = datetime.datetime.strptime(start_timestamp_str, ts_format) + end_ts = datetime.datetime.strptime(end_timestamp_str, ts_format) return (end_ts - start_ts).total_seconds() # datetime.datetime.now(datetime.UTC) def get_timestamp_iso(current_time=datetime.datetime.now(datetime.UTC)): - return current_time.isoformat()[:-3] + "Z" + return current_time.isoformat() # Return local date ISO formatted