Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.0.0-alpha.1"
".": "1.0.0-alpha.2"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.0.0-alpha.2 (2025-04-03)

Full Changelog: [v1.0.0-alpha.1...v1.0.0-alpha.2](https://github.com/hubmapconsortium/search-python-sdk/compare/v1.0.0-alpha.1...v1.0.0-alpha.2)

### Features

* reimplemented previous manual sdk fixes to correct 303 handling, and remove content type for get requests ([09f9c53](https://github.com/hubmapconsortium/search-python-sdk/commit/09f9c53c01d17e00f1a9f967516ed3deebabc480))
* Update README.md ([adec897](https://github.com/hubmapconsortium/search-python-sdk/commit/adec897fa3887c963334694752697bcbb74b2361))

## 1.0.0-alpha.1 (2025-04-02)

Full Changelog: [v0.0.1-alpha.0...v1.0.0-alpha.1](https://github.com/hubmapconsortium/search-python-sdk/compare/v0.0.1-alpha.0...v1.0.0-alpha.1)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Hubmap Search SDK Python API library
# HuBMAP Search SDK Python API Library

[![PyPI version](https://img.shields.io/pypi/v/hubmap_search_sdk.svg)](https://pypi.org/project/hubmap_search_sdk/)

The Hubmap Search SDK Python library provides convenient access to the Hubmap Search SDK REST API from any Python 3.8+
The HuBMAP Search SDK Python library provides convenient access to the HuBMAP Search REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "hubmap_search_sdk"
version = "1.0.0-alpha.1"
version = "1.0.0-alpha.2"
description = "The official Python library for the hubmap-search-sdk API"
dynamic = ["readme"]
license = "MIT"
Expand Down
12 changes: 12 additions & 0 deletions src/hubmap_search_sdk/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ def _build_request(
raise RuntimeError(f"Unexpected JSON data type, {type(json_data)}, cannot merge with `extra_body`")

headers = self._build_headers(options, retries_taken=retries_taken)
# If it's a GET request and there's no body (no json_data or extra_json), remove Content-Type
if options.method.lower()=='get' and not json_data:
headers.pop('Content-Type', None)
params = _merge_mappings(self.default_query, options.params)
content_type = headers.get("Content-Type")
files = options.files
Expand Down Expand Up @@ -999,6 +1002,15 @@ def _request(
response.raise_for_status()
except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code
log.debug("Encountered httpx.HTTPStatusError", exc_info=True)
if response.status_code in (301, 302, 303, 307, 308):
return self._process_response(
cast_to=cast_to,
options=options,
response=response,
stream=stream,
stream_cls=stream_cls,
retries_taken=retries_taken,
)

if remaining_retries > 0 and self._should_retry(err.response):
err.response.close()
Expand Down
2 changes: 1 addition & 1 deletion src/hubmap_search_sdk/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "hubmap_search_sdk"
__version__ = "1.0.0-alpha.1" # x-release-please-version
__version__ = "1.0.0-alpha.2" # x-release-please-version