Skip to content

Commit b4b7710

Browse files
necmotaeyong
authored andcommitted
Fix ArgNotSet repr to use stable string instead of memory address (apache#65222)
* Add tests for ArgNotSet serialization and repr/str behavior * Add serialize, __repr__, __str__ to ArgNotSet for deterministic serialization * Flip ArgNotSet repr/str test to expect sentinel string and use top-level imports * Delegate ArgNotSet __repr__/__str__ to serialize() for polymorphic sentinel strings --------- Co-authored-by: taeyong <taeyong4.kim@navercorp.com>
1 parent 09072b9 commit b4b7710

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • task-sdk/src/airflow/sdk/definitions/_internal

task-sdk/src/airflow/sdk/definitions/_internal/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def is_arg_passed(arg: Union[ArgNotSet, None] = NOTSET) -> bool:
4040
def serialize():
4141
return "NOTSET"
4242

43+
def __repr__(self) -> str:
44+
return self.serialize()
45+
46+
def __str__(self) -> str:
47+
return self.serialize()
48+
4349
@classmethod
4450
def deserialize(cls):
4551
return cls

0 commit comments

Comments
 (0)