Skip to content

Commit

Permalink
Merge pull request #125 from moj-analytical-services/get-database-nam…
Browse files Browse the repository at this point in the history
…e-from-user-id-reorder

Update role rules for database name
  • Loading branch information
gwionap authored Dec 1, 2023
2 parents e45eb7e + d09597e commit 526c2eb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v5.5.15 - 2023-12-01

- Updated aws role rules

## v5.5.14 - 2023-12-01

- Updated get_database_name_from_userid to apply explicit rules for roles
Expand Down
2 changes: 1 addition & 1 deletion pydbtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
)
from .utils import s3_path_join # noqa: F401

__version__ = "5.5.14"
__version__ = "5.5.15"
8 changes: 4 additions & 4 deletions pydbtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
r"@[a-z.-]+.gov.uk$", # gov email
r"@[a-z.-]+.gov.uk",
),
(
r"^[0-9]+", # numeric
None,
),
(
r"alpha_user_", # alpha user
None,
Expand All @@ -34,6 +30,10 @@
r"^[a-z0-9]{8}-airflow_", # airflow
r"[a-z0-9]{8}-",
),
(
r"^[0-9]+$", # numeric
None,
),
]


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool]
[tool.poetry]
name = "pydbtools"
version = "5.5.14"
version = "5.5.15"
description = "A python package to query data via amazon athena and bring it into a pandas df using aws-wrangler."
license = "MIT"
authors = ["Karik Isichei <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_pyproject_toml_matches_version():
("d347875:alpha_user_some-user", "alpha_user_some_user"),
("abcde:[email protected]", "my_name"),
("abcde:[email protected]", "my_name"),
("f7fd6d7d-airflow_prod_role_name", "airflow_prod_role_name"),
("3f7f9e93-airflow_prod_role_name", "airflow_prod_role_name"),
],
)
def test_clean_user_id(test_input, expected):
Expand Down

0 comments on commit 526c2eb

Please sign in to comment.