♻️ (schema.py): remove unnecessary blank line to improve code readability
♻️ (service.py): reformat SQL query string for better readability ♻️ (utils.py): remove unnecessary blank line to clean up code
This commit is contained in:
parent
817f85cfaf
commit
b3a3e7b8e5
3 changed files with 5 additions and 4 deletions
|
|
@ -36,6 +36,7 @@ class TransactionModel(BaseModel):
|
|||
return json.dumps(v)
|
||||
return v
|
||||
|
||||
|
||||
class TransactionModelResponse(BaseModel):
|
||||
index: Optional[int] = Field(default=None)
|
||||
timestamp: Optional[datetime] = Field(default_factory=datetime.now, alias="timestamp")
|
||||
|
|
|
|||
|
|
@ -168,8 +168,9 @@ class MonitorService(Service):
|
|||
order_by: Optional[str] = "timestamp",
|
||||
flow_id: Optional[str] = None,
|
||||
):
|
||||
|
||||
query = "SELECT index,flow_id, status, error, timestamp, vertex_id, inputs, outputs, target_id FROM transactions"
|
||||
query = (
|
||||
"SELECT index,flow_id, status, error, timestamp, vertex_id, inputs, outputs, target_id FROM transactions"
|
||||
)
|
||||
conditions = []
|
||||
if source:
|
||||
conditions.append(f"source = '{source}'")
|
||||
|
|
|
|||
|
|
@ -180,7 +180,6 @@ def build_clean_params(target: "Vertex") -> dict:
|
|||
|
||||
def log_transaction(flow_id, vertex: "Vertex", status, target: Optional["Vertex"] = None, error=None):
|
||||
try:
|
||||
|
||||
monitor_service = get_monitor_service()
|
||||
clean_params = build_clean_params(vertex)
|
||||
data = {
|
||||
|
|
@ -191,7 +190,7 @@ def log_transaction(flow_id, vertex: "Vertex", status, target: Optional["Vertex"
|
|||
"timestamp": monitor_service.get_timestamp(),
|
||||
"status": status,
|
||||
"error": error,
|
||||
"flow_id": flow_id
|
||||
"flow_id": flow_id,
|
||||
}
|
||||
monitor_service.add_row(table_name="transactions", data=data)
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue