Open MickJermsurawong opened 1 month ago
ah, the fix here is to set python path to your top level chronon configuration directory.
if vscode recognizes the path, compile.py should too.
thanks nikhil, yup appending python path works.. for now i have to add add pythonpath in unit test, wrapping for compile.py, and add ignore on mypy. I think it would be great if we can treat these definitions like native python resources using the standard python module references
They should work like standard python references actually - it is just that the python env needs to be setup to recognize chronon on the module. Or maybe I am misunderstanding, is it a wrong assumption for the framework to expect the top level chronon directory (sample
in this case) to be on python path?
Summary
I made a quick repro and curious on your input. I think when people define chronon features, it's expected they follow the structure, but it can live within some directories.. In that way, i think allowing flexible top module should be allowed. And we should be able to refer to chronon features object like other piece of python code. In this PR,
i'm adding a new unit test, simply importing the chronon features in unit test, and
pytest api/py/test/test_sample.py
will faili have to name change namespace import from
group_bys.quickstart.returns
tosample.group_bys.quickstart.returns
to make import work, now it fails couldn't find the module, although it's defined in a different file.Lastly, i updated the check and test pass
Why / Goal
Test Plan
Checklist
Reviewers