change db_utils name
Browse files- DB_utls.py → DB_utils.py +2 -2
- app.py +1 -1
- maintenance_flow.py +1 -1
DB_utls.py → DB_utils.py
RENAMED
|
@@ -18,14 +18,14 @@ def generate_empty_well():
|
|
| 18 |
dbclient = MongoClient(connection_string)
|
| 19 |
db = dbclient["LCM-OT-2-SLD"]
|
| 20 |
collection = db["wells-test"]
|
| 21 |
-
rows = ['
|
| 22 |
columns = [str(i) for i in range(1, 13)]
|
| 23 |
for row in rows:
|
| 24 |
for col in columns:
|
| 25 |
well = f"{row}{col}"
|
| 26 |
metadata = {
|
| 27 |
"well": well,
|
| 28 |
-
"status": "
|
| 29 |
"project": "OT2"
|
| 30 |
}
|
| 31 |
|
|
|
|
| 18 |
dbclient = MongoClient(connection_string)
|
| 19 |
db = dbclient["LCM-OT-2-SLD"]
|
| 20 |
collection = db["wells-test"]
|
| 21 |
+
rows = ['B', 'C', 'D', 'E', 'F', 'G', 'H']
|
| 22 |
columns = [str(i) for i in range(1, 13)]
|
| 23 |
for row in rows:
|
| 24 |
for col in columns:
|
| 25 |
well = f"{row}{col}"
|
| 26 |
metadata = {
|
| 27 |
"well": well,
|
| 28 |
+
"status": "empty",
|
| 29 |
"project": "OT2"
|
| 30 |
}
|
| 31 |
|
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import time
|
|
| 5 |
import paho.mqtt.client as mqtt
|
| 6 |
import json
|
| 7 |
import secrets
|
| 8 |
-
from
|
| 9 |
import os
|
| 10 |
from yt_utils import get_latest_video_id
|
| 11 |
from prefect import task, flow, pause_flow_run, resume_flow_run
|
|
|
|
| 5 |
import paho.mqtt.client as mqtt
|
| 6 |
import json
|
| 7 |
import secrets
|
| 8 |
+
from DB_utils import find_unused_wells, update_used_wells, save_result, get_student_quota, decrement_student_quota
|
| 9 |
import os
|
| 10 |
from yt_utils import get_latest_video_id
|
| 11 |
from prefect import task, flow, pause_flow_run, resume_flow_run
|
maintenance_flow.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from prefect import flow,get_run_logger, pause_flow_run, settings
|
| 2 |
from prefect.blocks.notifications import SlackWebhook
|
| 3 |
from prefect.context import get_run_context
|
| 4 |
-
from
|
| 5 |
|
| 6 |
@flow
|
| 7 |
def request_wells_maintenance(maintenance_type):
|
|
|
|
| 1 |
from prefect import flow,get_run_logger, pause_flow_run, settings
|
| 2 |
from prefect.blocks.notifications import SlackWebhook
|
| 3 |
from prefect.context import get_run_context
|
| 4 |
+
from DB_utils import set_maintenance_status,generate_empty_well,insert_maintenance_log
|
| 5 |
|
| 6 |
@flow
|
| 7 |
def request_wells_maintenance(maintenance_type):
|