Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
" skip_and_import_local_data(language)\n",
" display(Markdown(\"You choose to load the data from your local storage, you can skip the calls generation and move to [calls analysis](#calls_analysis)\"))\n",
"else:\n",
" create_tables()"
" create_tables(project_name=project_name)"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
source_code_target_dir: /home/mlrun_code/
image: .mlrun-project-image-call-center-demo
base_image: mlrun/mlrun-kfp
origin_url: git://github.com/mlrun/demo-call-center.git#refs/heads/main
origin_url: git://github.com/mlrun/demo-call-center.git#guy1992l-correction
workflows:
- image: .mlrun-project-image-call-center-demo
name: calls-generation
Expand All @@ -71,10 +71,10 @@ spec:
path: ./src/workflows/calls_analysis.py
params:
build_image: false
source: git://github.com/mlrun/demo-call-center.git#main
source: git://github.com/mlrun/demo-call-center.git#guy1992l-correction
gpus: 0
use_sqlite: false
default_image: .mlrun-project-image-call-center-demo
source: git://github.com/mlrun/demo-call-center.git#main
source: git://github.com/mlrun/demo-call-center.git#guy1992l-correction
conda: ''
default_image: .mlrun-project-image-call-center-demo
4 changes: 2 additions & 2 deletions project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def setup(
app.save()

# Create the DB tables:
create_tables()
create_tables(project_name=project.name)

# Save and return the project:
project.save()
Expand Down Expand Up @@ -357,4 +357,4 @@ def _set_workflows(project: mlrun.projects.MlrunProject, image):
)
project.set_workflow(
name="calls-analysis", workflow_path="./src/workflows/calls_analysis.py", image=image
)
)
5 changes: 3 additions & 2 deletions src/calls_analysis/db_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ def __del__(self):
pass


def create_tables():
def create_tables(project_name: str):
"""
Create the call center schema tables for when creating or loading the MLRun project.
"""
# Create an engine:
engine = DBEngine(mlrun.get_or_create_ctx("create_tables"))
engine = DBEngine(mlrun.get_or_create_ctx("create_tables", project=project_name))

# Create the schema's tables
Base.metadata.create_all(engine.engine)

Expand Down