Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join failed to get groupBy module on different file structure #868

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/py/ai/chronon/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def JoinPart(
gc.collect()
group_by_module_name = None
for ref in gc.get_referrers(group_by):
if "__name__" in ref and ref["__name__"].startswith("group_bys"):
if isinstance(ref, dict) and "__name__" in ref and "group_bys." in ref["__name__"]:
group_by_module_name = ref["__name__"]
break
if group_by_module_name:
Expand Down
6 changes: 3 additions & 3 deletions api/py/test/sample/joins/quickstart/training_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from ai.chronon.api.ttypes import Source, EventSource
from ai.chronon.query import Query, select

from group_bys.quickstart.purchases import v1 as purchases_v1
from group_bys.quickstart.returns import v1 as returns_v1
from group_bys.quickstart.users import v1 as users
from sample.group_bys.quickstart.purchases import v1 as purchases_v1
from sample.group_bys.quickstart.returns import v1 as returns_v1
from sample.group_bys.quickstart.users import v1 as users

"""
This is the "left side" of the join that will comprise our training set. It is responsible for providing the primary keys
Expand Down
6 changes: 6 additions & 0 deletions api/py/test/test_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from sample.joins.quickstart.training_set import source


def test_source():
assert source.events.table == "data.checkouts"