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

feat: enable feature store batch serve to Pandas DataFrame; fix: read instances uri for batch serve #983

Merged

Conversation

morgandu
Copy link
Contributor

  • add batch_to_df
  • add unit tests
  • add integration tests
  • fix bugs

…pdate: setup.py; fix: read_instances bug for batch_serve_to_*
@morgandu morgandu requested a review from sasha-gitg January 28, 2022 01:52
@morgandu morgandu requested a review from a team as a code owner January 28, 2022 01:52
project=self.project, credentials=self.credentials
)

featurestore_name_components = self._parse_resource_name(self.resource_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this method should include a self.wait call because it's possible they could run methods like create and create_entity_type with sync=False and then call this method. That may be the case else where in these classes.

Copy link
Contributor Author

@morgandu morgandu Jan 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. For create_entity_type the sync is on the EntityType class, where the self.wait will be needed for _parse_resource_name for its entity_type_name_components.

Checked and updated all methods in featurestore module who may have this issue.

temp_bq_dataset_name = f"temp_{featurestore_id}_{uuid.uuid4()}".replace(
"-", "_"
)
temp_bq_dataset_id = f"{initializer.global_config.project}.{temp_bq_dataset_name}"[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a TODO with with the project ID buganizer ID and description in locations where we reference the global config's project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

for message in reader.rows().pages:
frames.append(message.to_dataframe())

return None if not frames else pd.concat(frames)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use ignore_index=True or is the SOT for the index in the table or possibly message.to_dataframe() assigns incrementing index values?

Copy link
Contributor Author

@morgandu morgandu Feb 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore_index=True is needed. Updated.

for message in reader.rows().pages:
frames.append(message.to_dataframe())

return None if not frames else pd.concat(frames)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return type doesn't match the signature. I think we should return an empty pd.DataFrame if frames is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@morgandu morgandu added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 1, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 1, 2022
Copy link

@diemtvu diemtvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@morgandu morgandu added automerge Merge the pull request once unit tests and other checks pass. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 4, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 4, 2022
@morgandu morgandu force-pushed the mor--feature-store-batch-serve-to-df branch from 2cad0d4 to ca0d7bf Compare February 4, 2022 06:19
@morgandu morgandu added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 4, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 4, 2022
@gcf-merge-on-green
Copy link
Contributor

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 4, 2022
@morgandu morgandu added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 4, 2022
@yoshi-kokoro yoshi-kokoro removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 4, 2022
@morgandu morgandu added the automerge Merge the pull request once unit tests and other checks pass. label Feb 4, 2022
@morgandu morgandu changed the title feat: enable batch_serve_to_df; fix: read instances bugs for batch serve feat: enable feature store batch serve to Pandas DataFrame; fix: read instances for batch serve Feb 4, 2022
@morgandu morgandu changed the title feat: enable feature store batch serve to Pandas DataFrame; fix: read instances for batch serve feat: enable feature store batch serve to Pandas DataFrame; fix: read instances uri for batch serve Feb 4, 2022
@morgandu morgandu force-pushed the mor--feature-store-batch-serve-to-df branch from ca0d7bf to 290b07d Compare February 4, 2022 18:13
@morgandu morgandu added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed automerge Merge the pull request once unit tests and other checks pass. labels Feb 4, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 4, 2022
@morgandu morgandu merged commit e0fec36 into googleapis:main Feb 4, 2022
@morgandu morgandu self-assigned this Feb 8, 2022
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

Successfully merging this pull request may close these issues.

4 participants