Skip to content

Commit

Permalink
api - stop execute method name mangling
Browse files Browse the repository at this point in the history
Two underscores leads to class method name mangling.
Was not intended here.
  • Loading branch information
cherusk committed Nov 15, 2023
1 parent ccd283b commit 72c43c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/archive_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class archive_db():

@staticmethod
def __execute(db_info=None, query=""):
def _execute(db_info=None, query=""):
""" Function wrapping the curoser execute with
a dedicated connection for the execution."""

Expand Down
12 changes: 6 additions & 6 deletions api/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,39 +197,39 @@ def create_breeder(api_client, content):
db_config.update(dict(dbname=breeder_id))

__query = archive.queries.create_breeder_table(table_name=dag_name)
archive.archive_db.__execute(db_info=db_config, query=__query)
archive.archive_db.execute(db_info=db_config, query=__query)

for target in targets:
identifier = str(abs(hash(target.get('address'))))[0:6]
for run_id in range(0, parallel_runs):
dag_id = f'{dag_name}_{run_id}_{identifier}'

__query = archive.queries.create_breeder_table(table_name=dag_id)
archive.archive_db.__execute(db_info=db_config, query=__query)
archive.archive_db.execute(db_info=db_config, query=__query)

__query = archive.queries.create_procedure(procedure_name=f"{dag_id}_procedure",
probability=consolidation_probability,
source_table_name=dag_id,
target_table_name=dag_name)
archive.archive_db.__execute(db_info=db_config, query=__query)
archive.archive_db.execute(db_info=db_config, query=__query)

__query = archive.queries.create_trigger(trigger_name="{dag_id}_trigger",
table_name=dag_id,
procedure_name="{dag_id}_procedure")
archive.archive_db.__execute(db_info=db_config, query=__query)
archive.archive_db.execute(db_info=db_config, query=__query)

## create and fill breeder meta data db
db_config = META_DB_CONFIG.copy()
db_config.update(dict(dbname=breeder_id))
db_table_name = 'breeder_meta_data'

__query = meta_data.queries.create_meta_breeder_table(table_name=db_table_name)
archive.archive_db.__execute(db_info=db_config, query=__query)
archive.archive_db.execute(db_info=db_config, query=__query)

__query = meta_data.queries.insert_breeder_meta(table_name=db_table_name,
creation_ts=datetime.datetime.now(),
meta_state=breeder_config)
archive.archive_db.__execute(db_info=db_config, query=__query)
archive.archive_db.execute(db_info=db_config, query=__query)


with client.ApiClient(configuration) as api_client:
Expand Down

0 comments on commit 72c43c7

Please sign in to comment.