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
Yee
Yee
John Walk
06/28/2023, 7:37 PMJohn Walk
06/28/2023, 7:37 PMJohn Walk
06/28/2023, 7:38 PMJohn Walk
06/28/2023, 7:41 PMJohn Walk
06/28/2023, 7:42 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 errorJohn Walk
06/28/2023, 7:42 PMNone
lacks the ref
attribute needed to actually build the DAGJohn Walk
06/28/2023, 7:58 PMit 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
John Walk
06/30/2023, 2:53 PMhandle
function is built in our internal libraries - it looks like the RemoteEntity
returned by fetch_task
should work with flytekit.testing.patch
right?Yee
Yee
John Walk
06/30/2023, 4:03 PMYee
John Walk
06/30/2023, 4:10 PMYee
Yee
Yee
Yee
test_mocking_remote
testJohn Walk
07/06/2023, 3:54 PMJohn Walk
07/06/2023, 3:55 PMJohn Walk
07/06/2023, 7:16 PMfetch_remote
within our internals but that required defining a mock task with matching kwargs for each remote task, which is a little gnarlyJohn Walk
07/06/2023, 7:16 PMtask_mock
the RemoteEntity it grabs like you've got in yoursJohn Walk
07/06/2023, 7:28 PMYee
Yee
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