SIENTIAPDE-1445
Refactor imports and enhance timestamp handling in API and test files - Removed redundant import statements in api.py and prepare_worker.py for cleaner code. - Updated timestamp format in test cases to include timezone information for consistency. - Adjusted test configurations to align with new API structure for improved accuracy in data handling.
This commit is contained in:
@@ -9,9 +9,10 @@ with workflow.unsafe.imports_passed_through():
|
||||
from sientia_do.observability.logger import Logger
|
||||
from sientia_do.observability.metrics_controller import MetricsController
|
||||
from sientia_do.observability.sientia_monitoring import SientiaMonitoring
|
||||
from sientia_do.temporal.constants import DATETIME_FORMAT_WITH_TZ
|
||||
|
||||
from scouter.utils.clients.pi_web_api_client import PIWebAPIClient
|
||||
from sientia_do.temporal.constants import DATETIME_FORMAT_WITH_TZ
|
||||
|
||||
|
||||
class API(SientiaMonitoring):
|
||||
"""
|
||||
|
||||
@@ -213,7 +213,6 @@ class PIWebAPIClient(SientiaMonitoring):
|
||||
tags=core_labels,
|
||||
)
|
||||
|
||||
|
||||
status_code = c.getinfo(pycurl.RESPONSE_CODE)
|
||||
body = buffer.getvalue().decode('utf-8', errors='replace')
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import os
|
||||
import re
|
||||
from collections.abc import Sequence
|
||||
from typing import Any
|
||||
|
||||
from sientia_do.observability.logger import Logger
|
||||
from temporalio.client import Client
|
||||
from temporalio.worker import PollerBehaviorAutoscaling, Worker
|
||||
|
||||
from sientia_do.observability.logger import Logger
|
||||
|
||||
import re
|
||||
|
||||
parameters = [
|
||||
('MAX_CONCURRENT_WORKFLOW_TASKS', '200'),
|
||||
('MAX_CONCURRENT_ACTIVITIES', '200'),
|
||||
@@ -22,7 +20,6 @@ parameters = [
|
||||
('ACTIVITY_POLLER_BEHAVIUR_MAXIMUM', '200'),
|
||||
]
|
||||
|
||||
import re
|
||||
|
||||
def camel_to_kebab(text: str) -> str:
|
||||
"""Convert camelCase or PascalCase to kebab-case."""
|
||||
|
||||
@@ -20,9 +20,9 @@ with workflow.unsafe.imports_passed_through():
|
||||
build_postgres_config,
|
||||
build_redis_config,
|
||||
)
|
||||
from scouter.workflow.pi_web_api_scouter import PIWebAPIScouter
|
||||
from scouter.workflow.scouter import Scouter
|
||||
from scouter.workflow.sub_workflows.core_scouter import CoreScouter
|
||||
from scouter.workflow.pi_web_api_scouter import PIWebAPIScouter
|
||||
|
||||
# Environment configuration
|
||||
POD_ID = os.getenv('HOSTNAME', 'localhost')
|
||||
|
||||
Reference in New Issue
Block a user