Skip to content

Commit

Permalink
Only import domino within domino specific functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nrccua-timr committed Sep 7, 2023
1 parent 97c4494 commit 575e3d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ History
=======


v0.19.0 (2023-09-07)

* Only import domino within domino specific functions so it doesn't need to be installed when using ds_utils.
* Improve logging in ds_utils to log with timestamp before message.


v0.18.5 (2023-08-31)

* Remove dominodatalab as an install dependency.
Expand Down
12 changes: 9 additions & 3 deletions aioradio/ds_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@

import boto3
import pandas as pd
from domino import Domino
from smb.SMBConnection import SMBConnection

warnings.simplefilter(action='ignore', category=UserWarning)
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
MAX_SSL_CONTENT_LENGTH = (2 ** 31) - 1

logger = logging.getLogger(__name__)
logger.propagate = False
c_handler = logging.StreamHandler()
c_handler.setLevel(logging.INFO)
c_format = logging.Formatter('%(asctime)s: %(message)s')
c_handler.setFormatter(c_format)
logger.addHandler(c_handler)


def file_to_s3(s3_client, local_filepath, s3_bucket, key):
"""Write file to s3."""
Expand Down Expand Up @@ -256,6 +261,7 @@ def get_boto3_session(env):
def get_domino_connection(secret_id, project, host, env='sandbox'):
"""Get domino connection."""

from domino import Domino
secret_client = get_boto3_session(env).client("secretsmanager", region_name='us-east-1')
api_key = secret_client.get_secret_value(SecretId=secret_id)['SecretString']
return Domino(project=project, api_key=api_key, host=host)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
long_description = fileobj.read()

setup(name='aioradio',
version='0.18.5',
version='0.19.0',
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",
url='https://github.com/nrccua/aioradio',
author='NRCCUA Architects',
author='Encoura DS Team',
author_email='[email protected]',
license="MIT",
packages=[
Expand Down

0 comments on commit 575e3d2

Please sign in to comment.