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

SNOW-1932729: Add logging messages to snowpark-checkpoints-collectors #117

Open
wants to merge 7 commits into
base: feature/SNOW-1928731/main
Choose a base branch
from

Conversation

sfc-gh-fgonzalezmendez
Copy link
Contributor

@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez commented Feb 18, 2025

Motivation & Context

JIRA: SNOW-1932729

Description

This pull request introduces logging messages across multiple modules of the snowpark-checkpoints-collectors package. This messages aim to enhance the debugging and monitoring capabilities of the package.

How Has This Been Tested?

  • Added testing to validate the overall logging mechanism.
  • Added testing to validate important log messages.

Checklist

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Data correction (data quality issue originating from upstream source or dataset)
  • Cleanup and optimization (improvement that does not alter the data returned by a model)
  • Other (please specify)
  • I attest that this change meets the bar for low risk without security requirements as defined in the Accelerated Risk Assessment Criteria and I have taken the Risk Assessment Training in Workday.
    • Checking this checkbox is mandatory if using the Accelerated Risk Assessment to risk assess the changes in this Pull Request.
    • If this change does not meet the bar for low risk without security requirements (as confirmed by the peer reviewers of this pull request) then a formal Risk Assessment must be completed. Please note that a formal Risk Assessment will require you to spend extra time performing a security review for this change. Please account for this extra time earlier rather than later to avoid unnecessary delays in the release process.

Review & Approval Requests

Note: Use GitHub's draft PR feature instead of tagging a PR as DO NOT MERGE.

@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez changed the title Add logging messages to snowpark-checkpoints-collectors package SNOW-1932729: Add logging messages to snowpark-checkpoints-collectors package Feb 18, 2025
@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez force-pushed the feature/SNOW-1932729 branch 11 times, most recently from e0d263a to 73a553a Compare February 19, 2025 02:08
@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez changed the title SNOW-1932729: Add logging messages to snowpark-checkpoints-collectors package SNOW-1932729: Add logging messages to the snowpark-checkpoints-collectors package Feb 19, 2025
@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez changed the title SNOW-1932729: Add logging messages to the snowpark-checkpoints-collectors package SNOW-1932729: Add logging messages to snowpark-checkpoints-collectors Feb 19, 2025
@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez marked this pull request as ready for review February 19, 2025 15:38
Copy link
Contributor

@sfc-gh-lbravozuniga sfc-gh-lbravozuniga left a comment

Choose a reason for hiding this comment

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

I added a few suggestions.


if not is_checkpoint_enabled(normalized_checkpoint_name):
LOGGER.info(
"Checkpoint '%s' is disabled. Skipping collection.", checkpoint_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Checkpoint '%s' is disabled. Skipping collection.", checkpoint_name
"Checkpoint '%s' is disabled. Skipping collection.", normalized_checkpoint_name

Should we used normalized_checkpoint_name instead checkpoint_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 421a9dd

)
collection_point_result_manager.add_result(collection_point_result)
collection_point_result.result = CollectionResult.PASS
LOGGER.info("Checkpoint '%s' collected successfully", checkpoint_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LOGGER.info("Checkpoint '%s' collected successfully", checkpoint_name)
LOGGER.info("Checkpoint '%s' collected successfully", normalized_checkpoint_name)

Also here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 421a9dd


except Exception as err:
collection_point_result.result = CollectionResult.FAIL
error_message = str(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we report failed checkpoints in another catch or do we have to add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is not necessary. The exception raised by this except block will be caught by the log decorator. Any exception caught by the log decorator means that the collection failed.

raise Exception("No parquet files were generated.")
LOGGER.info(
"Wrote %s parquet files at '%s'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Wrote %s parquet files at '%s'",
"%s parquet files were written in '%s'",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 421a9dd

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.

3 participants