-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../launch.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import argparse | ||
import importlib | ||
|
||
import pandas as pd | ||
|
||
from aidb_utilities.command_line_setup.command_line_setup import command_line_utility | ||
from aidb_utilities.aidb_setup.aidb_factory import AIDB | ||
from aidb_utilities.db_setup.blob_table import BaseTablesSetup | ||
from aidb_utilities.db_setup.create_tables import create_output_tables | ||
from aidb.utils.asyncio import asyncio_run | ||
|
||
|
||
def setup_blob_tables(config): | ||
input_blobs = pd.read_csv(config.blobs_csv_file) | ||
base_table_setup = BaseTablesSetup(f"{config.DB_URL}/{config.DB_NAME}") | ||
base_table_setup.insert_blob_meta_data(config.blob_table_name, input_blobs, config.blobs_keys_columns) | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--config", type=str) | ||
parser.add_argument("--setup-blob-table", action='store_true') | ||
parser.add_argument("--setup-output-tables", action='store_true') | ||
parser.add_argument("--verbose", action='store_true') | ||
args = parser.parse_args() | ||
|
||
config = importlib.import_module(args.config) | ||
|
||
if args.setup_blob_table: | ||
setup_blob_tables(config) | ||
|
||
if args.setup_output_tables: | ||
asyncio_run(create_output_tables(config.DB_URL, config.DB_NAME, config.tables)) | ||
|
||
aidb_engine = AIDB.from_config(args.config, args.verbose) | ||
command_line_utility(aidb_engine) |