Skip to content

APP-5243: Migrate to httpx (goodbye requests 👋 ) #679

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

Aryamanz29
Copy link
Member

@Aryamanz29 Aryamanz29 commented Jul 14, 2025

  • Removed requirements files
  • Updated GitHub workflows for Docker image builds to use uv sync (without dev dependencies)
  • Breaking change: Dropped support for Python 3.8 (httpx-retries requires Python ≥ 3.9)

Other v8 Release Tasks:

  • Add Python version in headers
  • Add Prefetch paginator
  • Reduce test build time & coverage report generation
    (explore label-based test runs for async tests)
  • Fix SDK Sphinx docs build
  • Fix conda packages publish GitHub Action
  • Complete final SDK benchmarking
  • Create async dev docs (TBD)

✨ Description

Briefly explain the purpose of this PR and what it covers. Mention any related issues or Jira tickets.

Jira link:


🧩 Type of change

Select all that apply:

  • 🚀 New feature (non-breaking change that adds functionality)
  • 🐛 Bug fix (non-breaking change that fixes an issue) — please include tests! Refer testing-toolkit 🧪
  • 🔄 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🧹 Maintenance (chores, cleanup, minor improvements)
  • 💥 Breaking change (fix or feature that may break existing functionality)
  • 📦 Dependency upgrade/downgrade
  • 📚 Documentation updates

✅ How has this been tested? (e.g. screenshots, logs, workflow links)

Describe how the change was tested. Include:

  • Steps to reproduce
  • Any relevant screenshots, logs, or links to successful workflow runs
  • Details on environment/setup if applicable

📋 Checklist

  • My code follows the project’s style guidelines
  • I’ve performed a self-review of my code
  • I’ve added comments in tricky or complex areas
  • I’ve updated the documentation as needed
  • There are no new warnings from my changes
  • I’ve added tests to cover my changes
  • All new and existing tests pass locally

@Aryamanz29 Aryamanz29 requested a review from Copilot July 14, 2025 12:13
@Aryamanz29 Aryamanz29 self-assigned this Jul 14, 2025
@Aryamanz29 Aryamanz29 added feature New feature or request dependencies Pull requests that update a dependency file change Pyatlan change pull request cleanup breaking-change refactor labels Jul 14, 2025
Copilot

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@Aryamanz29 Aryamanz29 force-pushed the APP-5243 branch 2 times, most recently from 4a1f567 to 82d2354 Compare July 15, 2025 09:21
cursor[bot]

This comment was marked as outdated.

@Aryamanz29 Aryamanz29 force-pushed the APP-5243 branch 2 times, most recently from 652804a to 3ba2a99 Compare July 15, 2025 11:14
cursor[bot]

This comment was marked as outdated.

@Aryamanz29 Aryamanz29 requested a review from Copilot July 15, 2025 11:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Migrates the SDK from requests to httpx (using httpx-retries) and drops Python 3.8 support, updating tests, dependencies, and CI workflows accordingly.

  • Refactored AtlanClient to use httpx.Client with RetryTransport and new timeout/streaming logic
  • Updated unit and integration tests to mock and assert against httpx behavior
  • Removed requests from dependencies, bumped requires-python to ≥ 3.9, and adjusted GitHub Actions to no longer test on 3.8

Reviewed Changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/test_query_client.py Adapted mocks to support httpx streaming and reading
tests/unit/test_file_client.py Updated mocks and assertions for httpx file streaming
tests/unit/test_base_vcr_yaml.py Replaced requests calls with httpx equivalents
tests/unit/test_base_vcr_json.py Replaced requests calls with httpx equivalents
tests/integration/test_index_search.py Swapped requests exceptions and imports for httpx
requirements-dev.txt Removed legacy dev requirements file
pyproject.toml Dropped Python 3.8, removed requests, added httpx
pyatlan/client/common.py Switched retry import from urllib3 to httpx-retries
pyatlan/client/atlan.py Refactored client setup, API calls, timeout and streams
pyatlan/client/asset.py Wrapped retry errors in _wait_till_deleted
.github/workflows/pyatlan-test-cron.yaml Updated Python matrix to ≥ 3.9
.github/workflows/pyatlan-publish.yaml Changed uv sync to omit dev dependencies
.github/workflows/pyatlan-pr.yaml Dropped 3.8 from PR and vulnerability-scan inputs
.github/workflows/build_and_upload_conda_packages.yaml Removed 3.8 from conda build matrix
Comments suppressed due to low confidence (1)

.github/workflows/pyatlan-pr.yaml:40

  • [nitpick] Changing the vulnerability-scan inputs to scan the entire workspace may include unintended files. Specify the exact dependency files (e.g., requirements lock files) to limit the scan surface and reduce noise.
            inputs: .

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

attr_def = attr_cache_by_id.get(attr_id)
if not attr_def:
raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters(attr_id)

Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect Return Type Annotations in Metadata Cache

The static methods get_attr_id_for_name and get_attribute_def in CustomMetadataCacheCommon have incorrect return type annotations. Both are declared to return a tuple[..., bool] but only return the first element of the tuple, leading to type checking errors and potential runtime issues.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change change Pyatlan change pull request cleanup dependencies Pull requests that update a dependency file feature New feature or request refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant