Skip to content

Commit a10f787

Browse files
committed
Black fix
1 parent 2b68038 commit a10f787

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

src/config.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ class config:
88
collection_bucket = os.environ.get("COLLECTION_BUCKET", "local-collection-data")
99
issues_base_path = os.environ.get("ISSUES_BASE_PATH", "log/issue")
1010
performance_base_path = os.environ.get("PERFORMANCE_BASE_PATH", "data/performance")
11-
specification_base_path = os.environ.get("SPECIFICATION_BASE_PATH", "data/specification")
11+
specification_base_path = os.environ.get(
12+
"SPECIFICATION_BASE_PATH", "data/specification"
13+
)
1214
use_aws_credential_chain = (
1315
os.environ.get("USE_AWS_CREDENTIAL_CHAIN", "true").lower() == "true"
1416
)
15-

src/db.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
logger = get_logger(__name__)
99

10+
1011
def search_issues(params: IssuesParams):
1112
s3_uri = f"s3://{config.collection_bucket}/{config.issues_base_path}/**/*.parquet"
1213
pagination = f"LIMIT {params.limit} OFFSET {params.offset}"
@@ -52,6 +53,7 @@ def search_issues(params: IssuesParams):
5253
)
5354
raise e
5455

56+
5557
def search_provision_summary(params: ProvisionParams):
5658
s3_uri = f"s3://{config.collection_bucket}/{config.performance_base_path}/*.parquet"
5759
pagination = f"LIMIT {params.limit} OFFSET {params.offset}"
@@ -60,8 +62,10 @@ def search_provision_summary(params: ProvisionParams):
6062
if params.dataset:
6163
where_clause += _add_condition(where_clause, f"dataset = '{params.dataset}'")
6264
if params.organisation:
63-
where_clause += _add_condition(where_clause, f"organisation = '{params.organisation}'")
64-
65+
where_clause += _add_condition(
66+
where_clause, f"organisation = '{params.organisation}'"
67+
)
68+
6569
sql_count = f"SELECT COUNT(*) FROM '{s3_uri}' {where_clause}"
6670
logger.debug(sql_count)
6771
sql_results = f"SELECT * FROM '{s3_uri}' {where_clause} {pagination}"

src/main.py

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def issues(http_response: Response, params: IssuesParams = Depends()):
5151
headers=http_response.headers,
5252
)
5353

54+
5455
@app.get("/provision/provision_summary", tags=["provision_summary"])
5556
def provision_summary(http_response: Response, params: ProvisionParams = Depends()):
5657
paginated_result = db.search_provision_summary(params)
@@ -65,6 +66,7 @@ def provision_summary(http_response: Response, params: ProvisionParams = Depends
6566
headers=http_response.headers,
6667
)
6768

69+
6870
@app.get("/health", response_model=HealthCheckResponse, tags=["Health"])
6971
def healthcheck():
7072
return HealthCheckResponse(name="pipeline-api", version=app.version)

src/schema.py

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Issue(BaseModel):
3333
value: str
3434
message: str
3535

36+
3637
class ProvisionParams(BaseModel):
3738
offset: int = Field(0, ge=0)
3839
limit: int = Field(50, ge=1, le=100)

0 commit comments

Comments
 (0)