From e7a5af1f8b85b71b74d8e655c46519b7a8cb3ec7 Mon Sep 17 00:00:00 2001 From: adrian-wojcik Date: Thu, 26 Sep 2024 08:42:13 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Change=20flow=20and=20task?= =?UTF-8?q?=20name=20to=20`azure=5Fsql`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/viadot/orchestration/prefect/flows/__init__.py | 4 ++-- .../flows/{aselite_to_adls.py => azure_sql_to_adls.py} | 4 ++-- src/viadot/orchestration/prefect/tasks/__init__.py | 4 ++-- .../prefect/tasks/{aselite.py => azure_sql.py} | 2 +- ...{test_aselite_to_adls.py => test_azure_sql_to_adls.py} | 4 ++-- .../prefect/tasks/{test_aselite.py => test_azure_sql.py} | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) rename src/viadot/orchestration/prefect/flows/{aselite_to_adls.py => azure_sql_to_adls.py} (97%) rename src/viadot/orchestration/prefect/tasks/{aselite.py => azure_sql.py} (99%) rename tests/integration/orchestration/prefect/flows/{test_aselite_to_adls.py => test_azure_sql_to_adls.py} (95%) rename tests/integration/orchestration/prefect/tasks/{test_aselite.py => test_azure_sql.py} (93%) diff --git a/src/viadot/orchestration/prefect/flows/__init__.py b/src/viadot/orchestration/prefect/flows/__init__.py index cbc6ad151..72562581e 100644 --- a/src/viadot/orchestration/prefect/flows/__init__.py +++ b/src/viadot/orchestration/prefect/flows/__init__.py @@ -21,10 +21,10 @@ from .sql_server_to_parquet import sql_server_to_parquet from .transform import transform from .transform_and_catalog import transform_and_catalog -from .aselite_to_adls import aselite_to_adls +from .azure_sql_to_adls import azure_sql_to_adls __all__ = [ - "aselite_to_adls", + "azure_sql_to_adls", "cloud_for_customers_to_adls", "cloud_for_customers_to_databricks", "duckdb_to_parquet", diff --git a/src/viadot/orchestration/prefect/flows/aselite_to_adls.py b/src/viadot/orchestration/prefect/flows/azure_sql_to_adls.py similarity index 97% rename from src/viadot/orchestration/prefect/flows/aselite_to_adls.py rename to src/viadot/orchestration/prefect/flows/azure_sql_to_adls.py index 4ea4ac957..8f457bf51 100644 --- a/src/viadot/orchestration/prefect/flows/aselite_to_adls.py +++ b/src/viadot/orchestration/prefect/flows/azure_sql_to_adls.py @@ -4,7 +4,7 @@ from prefect import flow from prefect.task_runners import ConcurrentTaskRunner -from viadot.orchestration.prefect.tasks import df_to_adls, aselite_to_df +from viadot.orchestration.prefect.tasks import df_to_adls, azure_sql_to_df @flow( @@ -16,7 +16,7 @@ task_runner=ConcurrentTaskRunner, log_prints=True, ) -def aselite_to_adls( +def azure_sql_to_adls( query: str = None, credentials_secret: str = None, sep: str = "\t", diff --git a/src/viadot/orchestration/prefect/tasks/__init__.py b/src/viadot/orchestration/prefect/tasks/__init__.py index 1e4750f47..5117e6fc4 100644 --- a/src/viadot/orchestration/prefect/tasks/__init__.py +++ b/src/viadot/orchestration/prefect/tasks/__init__.py @@ -1,6 +1,6 @@ """Imports.""" -from .aselite import aselite_to_df +from .azure_sql import azure_sql_to_df from .adls import adls_upload, df_to_adls from .bcp import bcp from .cloud_for_customers import cloud_for_customers_to_df @@ -26,7 +26,7 @@ __all__ = [ - "aselite_to_df", + "azure_sql_to_df", "adls_upload", "df_to_adls", "bcp", diff --git a/src/viadot/orchestration/prefect/tasks/aselite.py b/src/viadot/orchestration/prefect/tasks/azure_sql.py similarity index 99% rename from src/viadot/orchestration/prefect/tasks/aselite.py rename to src/viadot/orchestration/prefect/tasks/azure_sql.py index 551ebd020..9c95efe23 100644 --- a/src/viadot/orchestration/prefect/tasks/aselite.py +++ b/src/viadot/orchestration/prefect/tasks/azure_sql.py @@ -15,7 +15,7 @@ @task(retries=3, retry_delay_seconds=10, timeout_seconds=60 * 60) -def aselite_to_df( +def azure_sql_to_df( query: str = None, credentials_secret: str = None, sep: str = "\t", diff --git a/tests/integration/orchestration/prefect/flows/test_aselite_to_adls.py b/tests/integration/orchestration/prefect/flows/test_azure_sql_to_adls.py similarity index 95% rename from tests/integration/orchestration/prefect/flows/test_aselite_to_adls.py rename to tests/integration/orchestration/prefect/flows/test_azure_sql_to_adls.py index 824bf3738..36dbd01a7 100644 --- a/tests/integration/orchestration/prefect/flows/test_aselite_to_adls.py +++ b/tests/integration/orchestration/prefect/flows/test_azure_sql_to_adls.py @@ -1,4 +1,4 @@ -from src.viadot.orchestration.prefect.flows import aselite_to_adls +from src.viadot.orchestration.prefect.flows import azure_sql_to_adls from src.viadot.sources import AzureDataLake from unittest.mock import patch @@ -22,7 +22,7 @@ def test_aselite_to_adls( mock_df = mock_aselite_to_df.return_value # Call the flow - aselite_to_adls( + azure_sql_to_adls( query=query, credentials_secret=aselite_credentials_secret, sep=",", diff --git a/tests/integration/orchestration/prefect/tasks/test_aselite.py b/tests/integration/orchestration/prefect/tasks/test_azure_sql.py similarity index 93% rename from tests/integration/orchestration/prefect/tasks/test_aselite.py rename to tests/integration/orchestration/prefect/tasks/test_azure_sql.py index 409dd70e5..357084d59 100644 --- a/tests/integration/orchestration/prefect/tasks/test_aselite.py +++ b/tests/integration/orchestration/prefect/tasks/test_azure_sql.py @@ -1,7 +1,7 @@ import pytest from unittest.mock import patch, MagicMock import pandas as pd -from src.viadot.orchestration.prefect.tasks import aselite_to_df +from src.viadot.orchestration.prefect.tasks import azure_sql_to_df @pytest.fixture @@ -33,7 +33,7 @@ def test_aselite_to_df( mock_df_converts_bytes_to_int.return_value = sample_dataframe # Call the function - aselite_to_df_result = aselite_to_df( + aselite_to_df_result = azure_sql_to_df( query="SELECT * FROM test_table", credentials_secret="test_secret", sep=",", @@ -57,7 +57,7 @@ def test_aselite_to_df( # Test case when remove_special_characters is True mock_df_clean_column.return_value = sample_dataframe - aselite_to_df( + azure_sql_to_df( query="SELECT * FROM test_table", credentials_secret="test_secret", sep=",", @@ -75,7 +75,7 @@ def test_aselite_to_df( # Test case for missing credentials_secret with pytest.raises(ValueError, match="`credentials_secret` has to be specified and not empty."): - aselite_to_df( + azure_sql_to_df( query="SELECT * FROM test_table", credentials_secret=None, )