Lee-W commented on issue #57695:
URL: https://github.com/apache/airflow/issues/57695#issuecomment-4312322143

   ```python
   from airflow.sdk import Asset, AllowedKeyMapper, PartitionAtRuntime, asset
   
   region_raw_stats = Asset(
       uri="file://incoming/player-stats/by-region.csv",
       name="region_raw_stats",
   )
   
   # Must be a module-level function so the timetable is serialisable:
   # the scheduler stores its dotted path and re-imports at scheduling time.
   # Lambdas, closures, and bound methods are rejected at construction.
   def list_active_regions() -> list[str]:
       ...
   
   @asset(
       uri="file://analytics/player-stats/regional-breakdown.csv",
       schedule=PartitionAtRuntime(
           assets=region_raw_stats,
           default_partition_mapper=AllowedKeyMapper(list_active_regions),
       ),
   )
   def regional_stats_breakdown():
       ...
   ```
   
   This could be how it works, but will affect #44146 implemented


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