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

Inconsistent logic with on_demand_feature_views #2072

Closed
MattDelac opened this issue Nov 19, 2021 · 0 comments · Fixed by #2090
Closed

Inconsistent logic with on_demand_feature_views #2072

MattDelac opened this issue Nov 19, 2021 · 0 comments · Fixed by #2090

Comments

@MattDelac
Copy link
Collaborator

Expected Behavior

We should be consistent across the repo about the default value of on_demand_feature_views. We also need to make our conditional statement more resilient as on_demand_feature_views is sometimes None and sometimes []

Current Behavior

The problem is that we often check if on_demand_feature_views is None but we sometimes set it's default value to an empty list

This has a huge impact as the RetrievalJob.to_arrow() method will use self._to_arrow_internal() or self._to_df_internal() depending on the on_demand_feature_views.

It makes it complicated to debug part of the codebase.

Steps to reproduce

Specifications

  • Version:
  • Platform:
  • Subsystem:

Possible Solution

Make the conditional statements more resilient

def had_on_demand_feature_views(on_demand_feature_views) -> bool:
    if on_demand_feature_views is None:
        return False
    if isinstance(on_demand_feature_views, list):
        if len(on_demand_feature_views) == 0:
            return False
    return True

if had_on_demand_feature_views(self.on_demand_feature_views):
    return features_df

instead of

if self.on_demand_feature_views is None:
    return features_df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants