Skip to content

Commit

Permalink
♻️ Change flow and task name to azure_sql
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-wojcik committed Sep 26, 2024
1 parent 862b72e commit e7a5af1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/viadot/orchestration/prefect/flows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/viadot/orchestration/prefect/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -26,7 +26,7 @@


__all__ = [
"aselite_to_df",
"azure_sql_to_df",
"adls_upload",
"df_to_adls",
"bcp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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=",",
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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=",",
Expand All @@ -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=",",
Expand All @@ -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,
)

0 comments on commit e7a5af1

Please sign in to comment.