Skip to content

fix: skip casting columns typed as typing.Any in rest_connector#228

Open
SAY-5 wants to merge 1 commit intopathwaycom:mainfrom
SAY-5:fix/typing-any-instantiate-227
Open

fix: skip casting columns typed as typing.Any in rest_connector#228
SAY-5 wants to merge 1 commit intopathwaycom:mainfrom
SAY-5:fix/typing-any-instantiate-227

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 5, 2026

Introduction

To contribute code to the Pathway project, start by discussing your proposed changes on Discord or by filing an issue.
Once approved, follow the fork + pull request model against the main branch, ensuring you've signed the contributor license agreement.

Context

pw.io.http.rest_connector builds a default schema with query: Any when no schema is supplied (_server.py L832). On every request, _cast_types_to_schema then runs payload[column] = exact_type(payload[column]), which becomes typing.Any(value) and raises TypeError: Cannot instantiate typing.Any (CPython typing.py _SpecialForm.__call__).

The cast is inside a try/except Exception that logs but silently drops the value, so every default-schema request loses its payload and emits a noisy traceback. Fix: skip the cast when the column's exact type is Any, since "any" means "no conversion".

How has this been tested?

Reproduced the failure path in isolation against the existing logic and confirmed the patched version no longer raises and leaves Any-typed values untouched while still casting other columns (e.g. int).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issue(s):

  1. [Bug]: TypeError: Cannot instantiate typing.Any #227

Checklist:

  • My code follows the code style of this project,
  • My change requires a change to the documentation,
  • I described the modification in the CHANGELOG.md file.

Calling typing.Any(value) raises TypeError, so requests against the
default rest_connector schema (which infers query as Any) failed
on every payload. Skip the cast when the column type is Any.

Fixes pathwaycom#227

Signed-off-by: SAY-5 <say.apm35@gmail.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 5, 2026

CLA assistant check
All committers have signed the CLA.

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.

2 participants