Skip to content

Conversation

@yashwantbezawada
Copy link

@yashwantbezawada yashwantbezawada commented Nov 6, 2025

Changes being requested

Fixes #2717 - poll() methods in vector_stores now pass parameters correctly

The poll() methods in both Files and FileBatches were passing IDs as positional arguments instead of named parameters when calling retrieve(). This causes TypeError because retrieve() expects named parameters.

Fixed in 4 locations:

  • FileBatches.poll() (sync) - line 295
  • AsyncFileBatches.poll() (async) - line 632
  • Files.poll() (sync) - line 337
  • AsyncFiles.poll() (async) - line 745

Changed from:

batch_id,  # positional
vector_store_id,

To:

batch_id=batch_id,  # named parameter
vector_store_id=vector_store_id,

Additional context & links

Issue: #2717
Affected: All users calling poll() on vector store files or file batches
Impact: Method was failing with TypeError when trying to poll for completion status

Fixes openai#2717

The poll() methods in both Files and FileBatches were passing IDs as
positional arguments instead of named parameters when calling retrieve().

This causes TypeError when retrieve() tries to match parameters, since
the method signature expects named parameters.

Fixed in 4 locations:
- FileBatches.poll() (sync)
- AsyncFileBatches.poll() (async)
- Files.poll() (sync)
- AsyncFiles.poll() (async)

Changed from positional to named parameters:
- batch_id, -> batch_id=batch_id,
- file_id, -> file_id=file_id,
@yashwantbezawada yashwantbezawada force-pushed the fix/vector-stores-poll-params-clean branch from b5b412a to a458faa Compare November 6, 2025 02:14
@karpetrosyan
Copy link
Collaborator

Can you provide a minimal reproducible example how we can get the error? The current implementation works for me, and it seems like the first argument can be positional, for the both classes

@yashwantbezawada
Copy link
Author

Thank you for the feedback @karpetrosyan! You're absolutely right - I need to withdraw this PR.

Analysis

After reviewing the retrieve() method signatures more carefully:

def retrieve(self, batch_id: str, *, vector_store_id: str, ...):

The first parameter (batch_id or file_id) can be positional because it comes before the * separator. Only parameters after * are required to be keyword-only.

Original Issue #2724

I initially thought the parameter passing was related to issue #2724 (where poll() returns the wrong ID), but upon investigation:

Conclusion

I'm closing this PR as the changes are unnecessary - the current implementation is correct. My apologies for the noise.

If there's a real bug with poll() methods, it would need a different fix than parameter name changes.

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