Yicong-Huang opened a new issue, #4736:
URL: https://github.com/apache/texera/issues/4736
### What happened?
`amber/src/main/python/core/models/operator.py::SourceOperator` declares
`__internal_is_source = True` at class level. Python name-mangles that
attribute name to `_SourceOperator__internal_is_source`, but
`Operator.is_source` (defined on the `Operator` base class) reads
`self.__internal_is_source` which mangles to
`self._Operator__internal_is_source`. These are two different attributes, so a
fresh `SourceOperator` subclass instance reports `is_source = False` despite
the class-level declaration.
The runtime contract is currently held together by
`ExecutorManager.initialize_executor`, which calls the public setter
`executor.is_source = is_source` after instantiation — meaning the class-level
declaration in `SourceOperator` is dead code that misleads readers.
### How to reproduce?
```python
from core.models import SourceOperator
class Foo(SourceOperator):
def produce(self):
yield None
f = Foo()
print(f.is_source) # False (expected
True if class attr worked)
print(getattr(f, "_SourceOperator__internal_is_source")) # True (the dead,
mangled attr)
print(getattr(f, "_Operator__internal_is_source")) # False (the attr
the property reads)
```
### Version
1.1.0-incubating (Pre-release/Master)
--
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]