Skip to content

Commit 4fcf776

Browse files
authored
Fix Pydantic 2 configuration binding errors (#326)
* Pydantic 2 configuration binding errors * isort fix
1 parent 559bfca commit 4fcf776

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

deployment/bin/deploy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ fi
140140
if [[ -z $USER_AUTH ]]; then
141141
require_env "ARM_SUBSCRIPTION_ID"
142142
require_env "ARM_TENANT_ID"
143-
require_env "ARM_CLIENT_ID"
144-
require_env "ARM_USE_OIDC"
145-
146143
fi
147144

148145
setup_env

pctasks/core/pctasks/core/cosmos/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from azure.cosmos import CosmosClient
88
from azure.cosmos.aio import CosmosClient as AsyncCosmosClient
99
from azure.identity import DefaultAzureCredential
10-
from pydantic import field_validator, model_validator
10+
from pydantic import Field, field_validator, model_validator
1111
from typing_extensions import Self
1212

1313
from pctasks.core.constants import COSMOSDB_EMULATOR_HOST_ENV_VAR
@@ -38,7 +38,7 @@ def section_name(cls) -> str:
3838
key: Optional[str] = None
3939

4040
# Cast to empty string if `None` is provided
41-
test_container_suffix: Optional[str] = None
41+
test_container_suffix: Optional[str] = Field(default=None, validate_default=True)
4242

4343
database: str = DEFAULT_DATABASE_NAME
4444
workflows_container_name: str = DEFAULT_WORKFLOWS_CONTAINER

pctasks/core/pctasks/core/models/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TableSasConfig(PCBaseModel):
3232
class TableAccountKeyConfig(PCBaseModel):
3333
account_url: str
3434
account_name: str
35-
account_key: str
35+
account_key: Optional[str] = None
3636
table_name: str
3737

3838

pctasks/notify/pctasks/notify/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Optional
2+
13
from cachetools import cachedmethod
24

35
from pctasks.core.constants import DEFAULT_WEBHOOKS_TABLE_NAME
@@ -17,7 +19,7 @@ def section_name(cls) -> str:
1719
# Tables - used for downstream STAC event registrations
1820
tables_account_url: str
1921
tables_account_name: str
20-
tables_account_key: str
22+
tables_account_key: Optional[str] = None
2123
stac_webhooks_table_name: str = DEFAULT_WEBHOOKS_TABLE_NAME
2224

2325
@cachedmethod(

pctasks/router/pctasks/router/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def section_name(cls) -> str:
2424
# Tables - used for blob event registrations (source eventing)
2525
tables_account_url: str
2626
tables_account_name: str
27-
tables_account_key: Optional[str]
27+
tables_account_key: Optional[str] = None
2828
blob_trigger_registration_table_name: str = (
2929
DEFAULT_BLOB_TRIGGER_REGISTRATION_TABLE_NAME
3030
)

pctasks/run/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
FROM python:3.9-slim
1+
FROM mcr.microsoft.com/azurelinux/base/python:3.12
22

3-
ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
3+
RUN tdnf install ca-certificates azure-cli -y \
4+
&& tdnf clean all
45
ENV PIP_NO_CACHE_DIR=1
56
RUN pip install "setuptools>=65.5.1"
67

pctasks/run/pctasks/run/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ def section_name(cls) -> str:
7070
# Tables
7171
tables_account_url: str
7272
tables_account_name: str
73-
tables_account_key: Optional[str]
73+
tables_account_key: Optional[str] = None
7474
image_key_table_name: str = DEFAULT_IMAGE_KEY_TABLE_NAME
7575

7676
# Blob
7777
blob_account_url: str
7878
blob_account_name: str
79-
blob_account_key: Optional[str]
79+
blob_account_key: Optional[str] = None
8080
log_blob_container: str = DEFAULT_LOG_CONTAINER
8181
task_io_blob_container: str = DEFAULT_TASK_IO_CONTAINER
8282
code_blob_container: str = DEFAULT_CODE_CONTAINER

0 commit comments

Comments
 (0)