Skip to content

Fix runtime AttributeError and complete Apache 2.0 LICENSE#1

Open
ericoulster wants to merge 2 commits intoatoolz:mainfrom
ericoulster:fix/runtime-namespace-and-license
Open

Fix runtime AttributeError and complete Apache 2.0 LICENSE#1
ericoulster wants to merge 2 commits intoatoolz:mainfrom
ericoulster:fix/runtime-namespace-and-license

Conversation

@ericoulster
Copy link
Copy Markdown

Two fixes, one per commit so either can be reverted on its own.

runtime.py: get_execution_status and list_recent_runs both fail with AttributeError: module 'flyte' has no attribute 'Run' on the first call. The Run class isn't exported from the top-level flyte package — it's at flyte.remote.Run. And the listing method is listall, not list. Both reproducible against flyte 2.2.2:

>>> import flyte
>>> flyte.Run
AttributeError: module 'flyte' has no attribute 'Run'
>>> from flyte.remote import Run
>>> hasattr(Run, 'list'), hasattr(Run, 'listall')
(False, True)

The broad except Exception in both functions hides this. The visible symptom is just {"error": "status failed: module 'flyte' has no attribute 'Run'"}, which is easy to read as a config problem.

While I was in there I also tweaked the phase output: str(run.phase) returns 'ActionPhase.SUCCEEDED' because phase is an enum, so the status string ends up looking weird in the model's tool output. Using .name gives 'SUCCEEDED'.

LICENSE: the file currently shipped is the 17-line header notice that Apache 2.0 specifies for the top of source files, not the full 202-line license body. GitHub's license detector flags the repo as NOASSERTION for that reason, even though pyproject.toml declares license = "Apache-2.0". I swapped in the canonical text from apache.org.

The explicit "Copyright 2026 Andre Ahlert" line that was in the old file isn't in the new one — Apache's convention is to keep that in a separate NOTICE file, which I haven't added since you might want to phrase it differently.

get_execution_status and list_recent_runs raise AttributeError on first
call: the Run class is at flyte.remote.Run, not flyte.Run, and the
listing method is listall, not list. Verified against flyte 2.2.2.

The broad `except Exception` hides this. The visible symptom is just
{"error": "status failed: module 'flyte' has no attribute 'Run'"},
which is easy to mistake for a config issue.

Also use phase.name instead of str(phase) so the status string is
'SUCCEEDED' rather than 'ActionPhase.SUCCEEDED'.
The previous LICENSE was the 17-line header Apache recommends for the
top of source files, not the full 202-line license body. GitHub's SPDX
detector flags the repo as NOASSERTION for that reason, despite
pyproject.toml declaring Apache-2.0.

Replaced with the canonical text from apache.org. If you want to keep
the explicit "Copyright 2026 Andre Ahlert" assertion that was in the
old file, the conventional place for it is a NOTICE file (not added
here).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant