cool-father-88039
01/18/2024, 9:16 PMcool-father-88039
01/18/2024, 9:17 PMsquare-wire-39606
01/18/2024, 9:18 PMbrainy-truck-72938
01/18/2024, 9:18 PMcool-father-88039
01/18/2024, 9:25 PMdry-beach-38304
01/18/2024, 9:25 PMcool-father-88039
01/18/2024, 9:31 PMcool-father-88039
03/19/2024, 5:19 PMmetaflow==2.10 to metaflow[stubs]==2.11.5 to try out the new mypy stubs, and I'm running into some new problems. E.g., I have a function that's annotated to return a metaflow.Run and mypy gives an error saying it's actually returning a metaflow.client.core.Run. Shall I open a Github issue for this or is there a quick fix (beyond changing all my imports to come from metaflow.client.core)?dry-beach-38304
03/19/2024, 5:22 PMdry-beach-38304
03/19/2024, 5:23 PMdry-beach-38304
03/19/2024, 5:23 PMmetaflow.Run object is an alias for metaflow.client.core.Run so it should ideally not complain 🙂cool-father-88039
03/19/2024, 5:25 PMfrom metaflow import ( # type: ignore
Flow,
FlowSpec,
Parameter,
Run,
metadata,
namespace,
)
def get_runs_by_inference_date(inference_date: date) -> tuple[Run, Run]:
"""For a given inference date, return the relevant training and inference runs.
:param model_enum: the model
:param inference_date: the inference date to get prod runs for
:return: (Training run, Inference run)
"""
namespace(None)
# Inference run
inference_runs = Flow("Inference").runs(
"project_branch:prod.stage",
f"flow-code:{FLOW_CODE}",
)
inference_runs_on_date = [x for x in inference_runs if x.created_at.date() == inference_date]
assert len(inference_runs_on_date) > 0, "no inference runs located"
assert len(inference_runs_on_date) == 1, "multiple inference runs located"
inference_run = inference_runs_on_date[0]
training_runs = list(
Flow("Training").runs(
f"model-id:{inference_run.data.model_id}", # type: ignore
)
)
assert len(training_runs) > 0, "no training runs located"
assert len(training_runs) == 1, "multiple training runs located"
training_run = training_runs[0]
return training_run, inference_run
error: Incompatible return value type (got "tuple[metaflow.client.core.Run, metaflow.client.core.Run]", expected "tuple[metaflow.Run, metaflow.Run]") [return-value]cool-father-88039
03/19/2024, 5:28 PMpd.DataFrame is an alias to some deeper level module) but mypy doesn't complain about type hints using pd.DataFrame.dry-beach-38304
03/19/2024, 5:32 PMcool-father-88039
03/19/2024, 7:12 PM@kubernetes(image=KUBERNETES_IMAGE, node_selector=KUBERNETES_NODE_SELECTOR)
gives
error: Unexpected keyword argument "node_selector" for "kubernetes" [call-arg]
even though that is a valid arg.cool-father-88039
03/19/2024, 7:14 PM"MetaflowData" has no attribute <...>
when trying to access any artifactdry-beach-38304
03/19/2024, 7:45 PM