hussein-awala commented on code in PR #64610:
URL: https://github.com/apache/airflow/pull/64610#discussion_r3540063327


##########
task-sdk/src/airflow/sdk/api/client.py:
##########
@@ -858,16 +858,24 @@ def get(
         before: datetime | None = None,
         ascending: bool = True,
         limit: int | None = None,
+        partition_key: str | None = None,
+        partition_key_pattern: str | None = None,
     ) -> AssetEventsResponse:
         """Get Asset event from the API server."""
+        if partition_key is not None and partition_key_pattern is not None:
+            raise ValueError("partition_key and partition_key_pattern are 
mutually exclusive")
         common_params: dict[str, Any] = {}
         if after:
             common_params["after"] = after.isoformat()
         if before:
             common_params["before"] = before.isoformat()
         common_params["ascending"] = ascending
-        if limit:
+        if limit is not None:
             common_params["limit"] = limit
+        if partition_key is not None:
+            common_params["partition_key"] = partition_key
+        if partition_key_pattern is not None:
+            common_params["partition_key_pattern"] = partition_key_pattern

Review Comment:
   The `limit is not None` check is pre-existing (not introduced by this PR), 
so I left it untouched. For the new partition params I kept `is not None` 
intentionally: it lets an explicitly-provided empty string (`partition_key=""`) 
be forwarded as a real filter value rather than silently dropped by a truthy 
check. If you'd rather treat empty strings as "no filter", I'm happy to switch 
to a truthy check.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to