Skip to content

Commit

Permalink
fixed pre-commit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
PiaSchroeder committed Dec 19, 2023
1 parent 380e078 commit ae58504
Show file tree
Hide file tree
Showing 6 changed files with 4,252 additions and 4,254 deletions.
2 changes: 1 addition & 1 deletion src/pystatis/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
REGEX_DB = {
"genesis": re.compile("^((\d{5}-\d{4})|([0-9A-Z]{10}))$"),
"zensus": re.compile("^\d{4}[A-Z]-\d{4}$"),
"regio": re.compile("^((\d{5}-.{1,2}($|-.*$))|(A.*$)|([0-9A-Z]{10}$))")
"regio": re.compile("^((\d{5}-.{1,2}($|-.*$))|(A.*$)|([0-9A-Z]{10}$))"),
}

logger = logging.getLogger(__name__)
Expand Down
5,382 changes: 2,691 additions & 2,691 deletions src/pystatis/data/genesis_tables.csv

Large diffs are not rendered by default.

1,592 changes: 796 additions & 796 deletions src/pystatis/data/regioDB_tables.csv

Large diffs are not rendered by default.

1,510 changes: 755 additions & 755 deletions src/pystatis/data/zensusDB_tables.csv

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions src/pystatis/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

logger = logging.getLogger(__name__)


def identify_db(name: str) -> str:
"""Identify the required database by matching the item code to the database regex.
Args:
name (str): Query parameter 'name' corresponding to the item code.
Returns:
db_name (str): Name of matching database.
Returns:
db_name (str): Name of matching database.
"""
regex_db = config.get_db_identifiers()

Expand Down Expand Up @@ -51,13 +52,11 @@ def get_db_settings(db_name: str) -> tuple[str, str, str]:
def check_db_credentials(db_name: str) -> bool:
"""
Checks if a username and password is stored for the specified database.
Args:
db_name: Name of database to check credentials for.
Returns:
Returns:
TRUE if credentials were found, FALSE otherwise.
"""
return get_db_user(db_name) and get_db_pw(db_name)


5 changes: 2 additions & 3 deletions src/pystatis/http_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def get_data_from_endpoint(
break
else:
raise PystatisConfigError(
"Missing credentials!\n" \
f"To access this item you need to be a registered user of: {db_match} \n" \
"Missing credentials!\n"
f"To access this item you need to be a registered user of: {db_match} \n"
"Please run setup_credentials()."
)

Expand Down Expand Up @@ -336,4 +336,3 @@ def _check_destatis_status(destatis_status: dict) -> None:
logger.info(
"Code %d: %s", destatis_status_code, destatis_status_content
)

0 comments on commit ae58504

Please sign in to comment.