John Walk
06/28/2023, 4:09 PMtask_mock
can do for local python tasks? While I can get local patching working sometimes, it runs into issues e.g. with explicit task dependencies set like t1() >> t2()
where the return value (mocked as a python type) is missing some flyte node plumbing under the hood.Yee
John Walk
06/28/2023, 7:37 PM__rshift__
logic, it seemingly works ok (though the patches are pretty sensitive to imports in the test...) but the above fails with an assertion errorNone
lacks the ref
attribute needed to actually build the DAGit should work, and even if there are cases where they don’t we need to improve our error messaging to explain why.I suspect the issue is actually in our guidance for how to mock these, tbh
handle
function is built in our internal libraries - it looks like the RemoteEntity
returned by fetch_task
should work with flytekit.testing.patch
right?Yee
John Walk
06/30/2023, 4:03 PMYee
John Walk
06/30/2023, 4:10 PMYee
test_mocking_remote
testJohn Walk
07/06/2023, 3:54 PMfetch_remote
within our internals but that required defining a mock task with matching kwargs for each remote task, which is a little gnarlytask_mock
the RemoteEntity it grabs like you've got in yoursYee
John Walk
07/06/2023, 8:07 PMthat feeds the interface and the interface needs to be correctly defined.yeah, unless we can get at mocking the internal RemoteEntity reckon we're stuck with it