Skip to content

Conversation

@LifeJiggy
Copy link

🛠️ Fix: kubernetes.get_kubeconfig & invoices.get_pdf_by_uuid Download Issues

This PR resolves two major issues in the pydo client, ensuring users can successfully download Kubernetes configuration files and PDF invoices from the DigitalOcean API.


🐛 Issues Addressed

  1. kubernetes.get_kubeconfig() — YAML Download

    • Problem: YAML responses were incorrectly parsed as JSON, causing deserialization errors.
    • Solution: Method now returns raw YAML content directly (no JSON parsing).
    • Impact: Users can reliably download Kubernetes configuration files.
  2. invoices.get_pdf_by_uuid() — PDF Download

    • Problem: Binary PDF responses were incorrectly parsed as JSON.
    • Solution: Method now returns raw PDF bytes directly.
    • Impact: Users can download PDF invoices without errors.

🔧 Technical Improvements

  • Custom method overrides added to src/pydo/operations/_patch.py.
  • Tests updated:
    • test_kubernetes.py: Kubeconfig test now expects raw YAML.
    • test_billing.py: PDF test now expects bytes content.
    • Removed @pytest.skip from kubeconfig test.
  • All changes maintain backward compatibility for other client operations.

✅ Testing

  • All mocked tests pass.
  • Methods return correct content types (YAML, PDF) as expected.

📄 Files Changed

  • src/pydo/operations/_patch.py
  • tests/mocked/test_kubernetes.py
  • tests/mocked/test_billing.py

Feedback and suggestions welcome!

@LifeJiggy
Copy link
Author

Hi! My PR #555 is blocked waiting for workflow and code review approval. Could a maintainer please approve the workflow and review the changes?

@LifeJiggy
Copy link
Author

Hi maintainers!
Just following up on this PR. Please let me know if any changes are needed, or if you have feedback.
Thanks for your time and for maintaining pydo!

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.

1 participant