Skip to content

Commit

Permalink
Update license years and refactor DataPath-Client relation a bit (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
george-zubrienko authored Jan 11, 2024
1 parent 8690742 commit fcf0b25
Show file tree
Hide file tree
Showing 95 changed files with 186 additions and 103 deletions.
2 changes: 1 addition & 1 deletion adapta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Global index.
"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Package version.
"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/connectors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/connectors/service_bus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""init file"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/connectors/service_bus/_connector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Connector for Azure Service Bus.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Module index.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
18 changes: 15 additions & 3 deletions adapta/logs/_async_logger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Asyncio-safe implementation of a Semantic Logger.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -125,13 +125,25 @@ def debug(
template=template, logger=self._logger, tags=tags, exception=exception, diagnostics=diagnostics, **kwargs
)

def __enter__(self):
def start(self):
"""
Starts the async listener.
"""
self._listener = QueueListener(self._logger_message_queue, *self._log_handlers, respect_handler_level=True)
self._listener.start()

def stop(self):
"""
Stops the async listener and flushes the buffer out to all handlers.
"""
self._listener.stop()

def __enter__(self):
self.start()
return self

def __exit__(self, exc_type, exc_val, exc_tb):
self._listener.stop()
self.stop()


def create_async_logger(
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Adapta Logging Interface.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/_internal.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Classes for internal use by `adapta.logs` module. Should not be imported outside this module"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/_internal_logger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Shared functionality for the MetadataLogger enricher implementations.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/handlers/datadog_api_handler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Logging handler for DataDog.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/handlers/safe_stream_handler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Logging handler for Stdout that does not create duplicates if stdout redirection is used
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Module index.
"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/models/_log_level.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Standard log levels.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/logs/models/_logs_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Models for log messages
"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Import index.
"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/metrics/_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Metrics integration abstraction.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/metrics/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/metrics/providers/datadog_provider.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Implementation of a metrics provider for Datadog.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/ml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Import index.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/ml/_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Machine learning model module"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/ml/mlflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Import index"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/ml/mlflow/_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Thin wrapper for Mlflow operations.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/ml/mlflow/_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Mlflow python model module"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/process_communication/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Import index.
"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
11 changes: 3 additions & 8 deletions adapta/process_communication/_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Models used for inter-process communication in data processing applications.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@

from dataclasses_json import DataClassJsonMixin

from adapta.storage.models import parse_data_path
from adapta.storage.models.astra import AstraPath
from adapta.storage.models.base import DataPath
from adapta.storage.models.azure import AdlsGen2Path, WasbPath
Expand Down Expand Up @@ -61,13 +62,7 @@ def parse_data_path(
:return:
"""
for candidate in candidates:
try:
return candidate.from_hdfs_path(self.data_path)
except: # pylint: disable=W0702
continue

return None
return parse_data_path(self.data_path, candidates=candidates)

def serialize(self) -> str:
"""
Expand Down
2 changes: 1 addition & 1 deletion adapta/schema_management/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/schema_management/schema_entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Import index.
"""

# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/_azure_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Azure Cloud implementation of AuthenticationClient.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Base client for all infrastructure providers.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/_local_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Client representing Local infrastructure. Mainly used for unit tests.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/aws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Import index
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/aws/_aws_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Amazon Web Services implementation of AuthenticationClient.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/aws/_aws_credentials.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Contains credentials provider for AWS clients
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/hashicorp_vault/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Hashicorp Vault implementation of AuthenticationClient.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Hashicorp Vault implementation of AuthenticationClient.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/hashicorp_vault/oidc_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Hashicorp Vault implementation of AuthenticationClient.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion adapta/security/clients/hashicorp_vault/token_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Hashicorp Vault implementation of AuthenticationClient.
"""
# Copyright (c) 2023. ECCO Sneaks & Data
# Copyright (c) 2023-2024. ECCO Sneaks & Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit fcf0b25

Please sign in to comment.