From f3d81284e77438a6fa325c103ae9087afaf71e15 Mon Sep 17 00:00:00 2001 From: Tim Reichard Date: Fri, 8 Dec 2023 09:48:13 -0600 Subject: [PATCH] Add function ese_db_catalog in ds_utils --- HISTORY.rst | 7 +++++++ aioradio/ds_utils.py | 14 ++++++++++++++ aioradio/requirements.txt | 8 ++++---- setup.py | 2 +- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 46c1e74..b9de550 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,13 @@ History ======= +v0.20.5 (2023-12-08) + +* Add function ese_db_catalog in ds_utils. +* Update pandas==2.1.4. +* Update polars==0.19.19. + + v0.20.4 (2023-12-01) * Fix bug with sql statement in function ds_utils.read_constants_from_db. diff --git a/aioradio/ds_utils.py b/aioradio/ds_utils.py index c155751..b54ada4 100644 --- a/aioradio/ds_utils.py +++ b/aioradio/ds_utils.py @@ -62,6 +62,20 @@ def db_catalog(env): return catalog +def ese_db_catalog(env): + """Return the ESE DataBricks catalog based on the passed in environment.""" + + catalog = '' + if env == 'sandbox': + catalog = 'ese_dev' + elif env == 'stage': + catalog = 'ese_stg' + elif env == 'prod': + catalog = 'ese_prd' + + return catalog + + def sql_to_polars_df(sql): """Get polars DataFrame from SQL query results.""" diff --git a/aioradio/requirements.txt b/aioradio/requirements.txt index 621c3a3..2b39e58 100644 --- a/aioradio/requirements.txt +++ b/aioradio/requirements.txt @@ -16,17 +16,17 @@ mandrill==1.0.60 moto==3.1.18 openpyxl==3.0.10 orjson==3.8.10 -pandas==2.1.3 -polars==0.19.18 +pandas==2.1.4 +polars==0.19.19 pre-commit==3.5.0 psycopg2-binary==2.9.9 -pyarrow==13.0.0 +pyarrow==14.0.1 pylint==3.0.2 pyodbc==4.0.39 --no-binary=pyodbc pysmb==1.2.9.1 pyspark==3.4.1 pytest==7.4.3 -pytest-asyncio==0.21.1 +pytest-asyncio==0.23.2 pytest-cov==4.1.0 python-json-logger==2.0.7 redis==5.0.1 diff --git a/setup.py b/setup.py index ab4b5e8..e81db9d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ long_description = fileobj.read() setup(name='aioradio', - version='0.20.4', + version='0.20.5', description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more', long_description=long_description, long_description_content_type="text/markdown",