-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Expose accumulated metrics #813
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
base: main
Are you sure you want to change the base?
Conversation
📜 Docstring Coverage ReportRESULT: PASSED (minimum: 30.0%, actual: 75.6%) Detailed Coverage Report |
📦 Trivy Vulnerability Scan Results
Report Summary
Scan Result Details✅ No vulnerabilities found during the scan for |
📦 Trivy Secret Scan Results
Report Summary
Scan Result Details✅ No secrets found during the scan for |
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
|
🛠 Full Test Coverage Report: https://k.atlan.dev/coverage/application-sdk/pr/813 |
|
🛠 Docs available at: https://k.atlan.dev/application-sdk/APP-8299 |
| ) | ||
| await transformed_output.write_daft_dataframe(transform_metadata) | ||
| return await transformed_output.get_statistics() | ||
| return await transformed_output.get_statistics(typename=typename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Metadata Handling Flaw Breaks Data Transformation
The write_daft_dataframe call is outside the conditional block that assigns transform_metadata. When the dataframe is empty, transform_metadata will be undefined causing a NameError. Additionally, if multiple dataframes are processed and some are empty, the write operation will incorrectly reuse the previous non-empty transformation result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Update Test for File Handling Changes
The test expects file to be opened with mode "w" and path /test/path/statistics.json.ignore, but the implementation now uses mode "wb" and path /test/path/statistics/statistics.json.ignore. The test needs updating to match the new implementation.
tests/unit/outputs/test_output.py#L139-L140
application-sdk/tests/unit/outputs/test_output.py
Lines 139 to 140 in 7ecb605
| } | |
| mock_file.assert_called_once_with("/test/path/statistics.json.ignore", "w") |
| assert result is None | ||
| mock_logger.assert_called_once() | ||
| assert "Error writing statistics" in mock_logger.call_args[0][0] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog
Additional context (e.g. screenshots, logs, links)
Checklist
Copyleft License Compliance
Note
Propagates typename into statistics and writes stats files under a new statistics/ directory, updating SQL transform to pass typename.
Output.get_statisticsnow forwardstypenametowrite_statistics.write_statistics(typename)addstypenameto payload, writes tostatistics/statistics.json.ignore(orstatistics-chunk-{chunk_start}.json.ignore), and uploads that path._infer_phase_from_pathutility.transform_datanow callstransformed_output.get_statistics(typename=typename)to ensuretypenameis captured in stats.tests/unit/outputs/test_output.pyaligned with statistics writing behavior.Written by Cursor Bugbot for commit 7ecb605. This will update automatically on new commits. Configure here.