aic-utils 0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aic_utils/__init__.py +4 -0
- aic_utils/aic_utils.py +22 -0
- aic_utils-0.1.dist-info/METADATA +14 -0
- aic_utils-0.1.dist-info/RECORD +6 -0
- aic_utils-0.1.dist-info/WHEEL +5 -0
- aic_utils-0.1.dist-info/top_level.txt +1 -0
aic_utils/__init__.py
ADDED
aic_utils/aic_utils.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# aic_utils.py
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
|
|
5
|
+
def get_dataset_id(alias, QA):
|
|
6
|
+
# MAP WRITES TO QA OR PROD TABLES
|
|
7
|
+
df = pyspark_utils.get_pandas_from_aic_table('Silver',
|
|
8
|
+
'LKP_QA_TABLE_MAPPING')
|
|
9
|
+
row = df[df['alias'] == alias]
|
|
10
|
+
|
|
11
|
+
# Choose the appropriate column based on QA flag
|
|
12
|
+
if QA:
|
|
13
|
+
target_col = 'qa_dataset'
|
|
14
|
+
else:
|
|
15
|
+
target_col = 'prod_dataset'
|
|
16
|
+
|
|
17
|
+
# Return the dataset ID
|
|
18
|
+
if not row.empty:
|
|
19
|
+
return row.iloc[0][target_col]
|
|
20
|
+
else:
|
|
21
|
+
raise ValueError("Alias not found in mapping table")
|
|
22
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: aic_utils
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: A utility package for dataset ID retrieval
|
|
5
|
+
Home-page: https://github.com/dylandoyle11/aic_utils
|
|
6
|
+
Author: Dylan D
|
|
7
|
+
Author-email: dylan.doyle@jdpa.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: pandas
|
|
13
|
+
|
|
14
|
+
TEST
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
aic_utils/__init__.py,sha256=GL2sHt8FEUeSfo1fMcQASjoK60pvQU-MrB2BcHXTmb4,50
|
|
2
|
+
aic_utils/aic_utils.py,sha256=rBSr01iyu9zbr9iB9WBKEuvu2kRk5zda7oSMkOhlFfc,540
|
|
3
|
+
aic_utils-0.1.dist-info/METADATA,sha256=8ErVkVFmFOEr10pyw1cLgr4laO-08JNPNzJBDGT6Cb8,421
|
|
4
|
+
aic_utils-0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
5
|
+
aic_utils-0.1.dist-info/top_level.txt,sha256=zF5OqTEN2RfUai8mFbsetBdd79sm6W09fZQXf7TjJ6E,10
|
|
6
|
+
aic_utils-0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aic_utils
|