airflow icon indicating copy to clipboard operation
airflow copied to clipboard

subclassed ObjectStoragePath of new upath has some quirks

Open bolkedebruin opened this issue 1 year ago • 0 comments

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.

bolkedebruin avatar Feb 20 '24 18:02 bolkedebruin