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

[Bug] Join failed to get groupBy module on different file structure #867

Open
mickjermsurawong-openai opened this issue Oct 17, 2024 · 2 comments

Comments

@mickjermsurawong-openai
Copy link
Contributor

  • Join code expects to get module object from the groupby that looks like below
    for ref in gc.get_referrers(group_by):
    if "__name__" in ref and ref["__name__"].startswith("group_bys"):
    group_by_module_name = ref["__name__"]
{'__name__': 'chronon_features.joins.quickstart.training_set', 
'__doc__': None, 
'__package__': 'chronon_features.joins.quickstart', 
'__loader__': <ddtrace.internal.module._ImportHookChainedLoader object at 0x110e7aed0>, '__spec__': ModuleSpec(name='chronon_features.joins.quickstart.training_set'
...
}
  • One potential problem, when referrer of the group_by isn't a dict or iterable, (In my case JoinPart object itself is the referrer, this check would fail
TypeError: argument of type 'JoinPart' is not iterable
  • Second potential problem, the check of name starting "group_bys" assumes that we have group_by as top-level. In my case, i have a separate python project chronon_features, so it would expect module name as chronon_features.group_bys
@nikhilsimha
Copy link
Contributor

nikhilsimha commented Oct 17, 2024

chronon is very convention driven & expects the following directory structure

your_top_level_directory # i recommend calling it chronon
   /joins
      /team1
         join1.py
         join2.py
         .
         .
      /team2
      .
      .  
   /group_bys
      /team1
         groupBy1.py
         .
         .
     /team2
     .
     .
   /staging_queries 

@mickjermsurawong-openai
Copy link
Contributor Author

hey @nikhilsimha thanks for taking a look, i made a repro to motivate my use case, pls help to take a look. not urgent
#868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants