-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added aws provider conversion config.
Signed-off-by: Varun Mittal <varunmittal91@gmail.com>
- Loading branch information
1 parent
eee32d9
commit 7d20c2d
Showing
5 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
focus_converter_base/focus_converter/conversion_configs/aws/D011_S001.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
plan_name: Assign provider | ||
conversion_type: static_value | ||
conversion_args: | ||
static_value: AWS | ||
column: NA | ||
focus_column: Provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
32 changes: 32 additions & 0 deletions
32
focus_converter_base/tests/provider_config_tests/aws/test_aws_provider.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from unittest import TestCase | ||
from unittest.mock import patch, PropertyMock | ||
|
||
import pandas as pd | ||
import polars as pl | ||
|
||
from focus_converter.configs.base_config import ConversionPlan | ||
from focus_converter.conversion_functions.column_functions import ColumnFunctions | ||
from focus_converter.converter import FocusConverter | ||
|
||
|
||
class TestAWSProvider(TestCase): | ||
def test_aws_provider_config(self): | ||
conversion_plan = ConversionPlan.load_yaml( | ||
"focus_converter/conversion_configs/aws/D011_S001.yaml" | ||
) | ||
|
||
focus_converter = FocusConverter() | ||
focus_converter.plans = {"aws": [conversion_plan]} | ||
column_exprs = focus_converter.prepare_horizontal_conversion_plan( | ||
provider="aws" | ||
) | ||
|
||
test_dataframe = pd.DataFrame([{"a": 1}]) | ||
|
||
test_pl_df = ( | ||
pl.from_dataframe(test_dataframe) | ||
.lazy() | ||
.with_columns(column_exprs) | ||
.collect() | ||
) | ||
self.assertEqual(list(test_pl_df["Provider"])[0], "AWS") |