Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function ese_db_catalog in ds_utils #118

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions aioradio/ds_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
8 changes: 4 additions & 4 deletions aioradio/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down