Skip to content

Commit 30cc6b4

Browse files
committed
Remove type hint
1 parent 2697cbf commit 30cc6b4

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

python/lib/sift_client/_internal/low_level_wrappers/ingestion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ async def get_ingestion_config_id_from_client_key(self, client_key: str) -> str
236236
raise ValueError(
237237
f"Expected 1 ingestion config for client key {client_key}, got {len(ingestion_configs)}"
238238
)
239-
return ingestion_configs[0].id
239+
return ingestion_configs[0].id_
240240

241241
def _new_ingestion_thread(
242242
self, ingestion_config_id: str, ingestion_config: IngestionConfigFormPy | None = None

python/lib/sift_client/_internal/low_level_wrappers/rules.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ async def get_rule(self, rule_id: str | None = None, client_key: str | None = No
7373
Raises:
7474
ValueError: If neither rule_id nor client_key is provided.
7575
"""
76-
if rule_id is None and client_key is None:
77-
raise ValueError("Either rule_id or client_key must be provided")
78-
7976
request_kwargs: dict[str, Any] = {}
8077
if rule_id is not None:
8178
request_kwargs["rule_id"] = rule_id
@@ -223,17 +220,16 @@ def _update_rule_request_from_update(
223220
# Special handling for the more complex fields.
224221
# Also, these must always be set.
225222
expression = model_dump.get("expression", rule.expression)
226-
channel_references = (
223+
channel_references: List[ChannelReference] = (
227224
update.channel_references
228225
if "channel_references" in model_dump
229226
else rule.channel_references
230-
)
227+
) or []
231228
action = update.action if "action" in model_dump else rule.action
232229
if bool(expression) != bool(channel_references):
233230
raise ValueError(
234231
"Expression and channel_references must both be provided or both be None"
235232
)
236-
assert channel_references is not None # make mypy happy
237233
expression_proto = RuleConditionExpression(
238234
calculated_channel=CalculatedChannelConfig(
239235
expression=expression,

python/lib/sift_client/types/ingestion.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class IngestionConfig(BaseType[IngestionConfigProto, "IngestionConfig"]):
3434
Model of the Sift Ingestion Config.
3535
"""
3636

37-
id: str
3837
asset_id: str
3938
client_key: str
4039

@@ -43,7 +42,7 @@ def _from_proto(
4342
cls, proto: IngestionConfigProto, sift_client: SiftClient | None = None
4443
) -> "IngestionConfig":
4544
return cls(
46-
id=proto.ingestion_config_id,
45+
id_=proto.ingestion_config_id,
4746
asset_id=proto.asset_id,
4847
client_key=proto.client_key,
4948
_client=sift_client,
@@ -79,7 +78,6 @@ def _to_rust_config(self) -> FlowConfigPy:
7978

8079
def add_channel(self, channel: Channel):
8180
if self.ingestion_config_id:
82-
# TODO: Do we allow this or not?
8381
raise ValueError("Cannot add a channel to a flow after creation")
8482
self.channels.append(channel)
8583

@@ -188,7 +186,6 @@ def _to_rust_value(channel: Channel, value: Any) -> IngestWithConfigDataChannelV
188186

189187

190188
def _to_rust_type(data_type: ChannelDataType) -> ChannelDataTypePy:
191-
# TODO: Make more elegant?
192189
if data_type == ChannelDataType.DOUBLE:
193190
return ChannelDataTypePy.Double
194191
elif data_type == ChannelDataType.FLOAT:

0 commit comments

Comments
 (0)