Open Conchylicultor opened 4 years ago
Working on it, can you please help me with few things which I don't get :
We have to implement DummyBeam
class in dummy_beam.py
which can be used as described in code above? or is above code is hint for implementing DummyBeam
? or can be used to test after implementing DummyBeam?
.
Sorry for trouble.
We have to implement DummyBeam class in dummy_beam.py
Yes. The code snippet above is an example of DummyBeam
usage.
Currently, implementing a beam dataset is quire painful due to lazy imports, which makes it impossible to use
beam.DoFn
,... in the global scope. It would be nice to be able to implement beam datasets without worrying about declaring beam methods only in the main scope.By replacing the
beam
module by a dummy no-op module, it would not crash when importing tensorflow datasets. It would greatly improve the usability:SomeFn()
,some_ptransform_fn()
,... raise the lazy import error ('Please install appache_beam')Once https://github.com/tensorflow/datasets/issues/1945 is done, the
try/except
could be replaced by:Note: Not all the beam API has to be implemented. New methods can be added on the go as they are needed.
The implementation could go into
/core/utils/dummy_beam.py
, and tests in/core/utils/dummy_beam_test.py
.