hussein-awala opened a new pull request, #64611:
URL: https://github.com/apache/airflow/pull/64611

   ## Part 2 of asset event querying enhancements
   
   This is a follow-up to #64610 (regex-based `partition_key` filtering). This 
PR adds the ability to filter asset events by their `extra` JSON field using 
key-value pairs.
   
   ## Changes
   
   ### REST API (Core)
   - New `extra` repeated query parameter on `/assets/events` endpoint (e.g. 
`?extra=region%3Dus&extra=env%3Dprod`)
   - Multiple `extra` params are combined with AND logic
   - Uses `_JsonKVFilter` parameter class with SQLAlchemy JSON element access 
(`column['key'].as_string()`)
   
   ### Execution API
   - Both `/by-asset` and `/by-asset-alias` endpoints accept `extra` as a 
repeated `key=value` query parameter
   
   ### Task SDK
   - `InletEventsAccessor.extra(key, value)` is chainable — each call 
accumulates into a dict for multi-condition filtering:
     ```python
     inlet_events[my_asset].extra("region", "us").extra("env", "prod")
     ```
   - Updated comms models (`GetAssetEventByAsset`, `GetAssetEventByAssetAlias`) 
with `extra: dict[str, str] | None`
   - Updated SDK client to serialize the dict as repeated `extra=key=value` 
query params
   - Updated supervisor to forward `extra` dict to the client
   
   ### Documentation
   - Updated `assets.rst` with examples for both Task SDK chaining and REST API 
usage
   
   ### Tests
   - Core API: parametrized tests for various key-value combinations and 
combined filters
   - Execution API: tests for both by-asset and by-alias endpoints with extra 
filtering
   - SDK client: mock transport tests for dict serialization and alias routing
   - Supervisor: updated all existing request test cases and added new 
extra-filter cases
   
   
   Made with [Cursor](https://cursor.com)


-- 
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