-
Notifications
You must be signed in to change notification settings - Fork 8
Refactor: moving code specific to miner from redshift to application-sdk #742
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
- preflight_check - get_workflow_args
📜 Docstring Coverage ReportRESULT: PASSED (minimum: 30.0%, actual: 75.6%) Detailed Coverage Report
|
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.
Pull Request Overview
This PR refactors code by moving miner-specific functions from redshift-app to application-sdk, making them accessible for broader use across different applications.
- Adds preflight_check and get_workflow_args methods to the SQL query extraction activity class
- Updates read_marker method to accept an optional output_path parameter
- Imports additional utility for credential parsing
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 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/742 |
🛠 Docs available at: https://k.atlan.dev/application-sdk/miner-refactor |
|
||
@activity.defn(name="miner_get_workflow_args") | ||
@auto_heartbeater | ||
async def get_workflow_args(self, workflow_config: Dict[str, Any]): |
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.
this should not have any code other than the super()...
resolved_output_path: str = ( | ||
output_path | ||
if isinstance(output_path, str) and output_path | ||
else base_output_path.rsplit("/", 1)[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.
this line can be made more readable. Either via using constants that tell what is at 1 and 0 index or via a comment stating 'why' this is being done - expected output.
@auto_heartbeater | ||
async def get_workflow_args(self, workflow_config: Dict[str, Any]): | ||
workflow_args = await super().get_workflow_args(workflow_config) | ||
if "credential_guid" in workflow_args: |
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.
nitpick - prefer using constants/variables when there is repeat use of key strings in a code snippet.
Changelog
Additional context (e.g. screenshots, logs, links)
Checklist
Copyleft License Compliance
Note
Adds miner preflight and workflow-args activities, enables marker reading with optional output path, and sets deployment_type from credential extras.
miner_preflight_check
andminer_get_workflow_args
activities delegating to base implementations.miner_get_workflow_args
: fetches credentials and setsworkflow_args["deployment_type"]
from parsed credentialextra
(defaultprovisioned
).read_marker
now accepts optionaloutput_path
, resolves path robustly, and uses stricter typing.cast
andparse_credentials_extra
for the above features.Written by Cursor Bugbot for commit 25bcb50. This will update automatically on new commits. Configure here.