airflow
airflow copied to clipboard
subclassed ObjectStoragePath of new upath has some quirks
Body
from airflow.io.path import ObjectStoragePath
a = 'file:///tmp/xcom/dag/scheduled__2021-12-03T04:56:00+00:00/task_1/a5e36734-11f2-4487-8aa7-46c70cc9718b'
b = 'file:///tmp/xcom'
y = ObjectStoragePath('file:///tmp/xcom/dag/scheduled__2021-12-03T04:56:00+00:00/task_1/d301899e-64bf-4a4d-8599-83c6cf097183')
x = ObjectStoragePath('file:///tmp/xcom')
y.is_relative_to(x)
False
from upath import UPath
x = UPath("file:///tmp/xcom/dag/scheduled__2021-12-03T04:56:00+00:00/task_1/d301899e-64bf-4a4d-8599-83c6cf097183")
y = UPath("file:///tmp/xcom")
print(x.is_relative_to(y))
True
cc @ap-- cc @potiuk
Committer
- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.