Skip to content

Get antfly-sdk runnable - #2

Open
dovinmu wants to merge 4 commits into
antflydb:mainfrom
dovinmu:claude/fix-import-bug-NCnWk
Open

Get antfly-sdk runnable#2
dovinmu wants to merge 4 commits into
antflydb:mainfrom
dovinmu:claude/fix-import-bug-NCnWk

Conversation

@dovinmu

@dovinmu dovinmu commented Jan 9, 2026

Copy link
Copy Markdown

Current version of the module won't run successfully, this gets it usable.

Before:
$ uv run --with "antfly-sdk @ git+https://github.com/antflydb/antfly-python.git@main" python -c "import antfly; print('done')"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/rowan/.cache/uv/archive-v0/o_7zLNKwYuZ9aixyMnr45/lib/python3.12/site-packages/antfly/__init__.py", line 5, in <module>
    from .client import AntflyClient
  File "/Users/rowan/.cache/uv/archive-v0/o_7zLNKwYuZ9aixyMnr45/lib/python3.12/site-packages/antfly/client.py", line 8, in <module>
    from antfly.client_generated.api.api_table import (
ModuleNotFoundError: No module named 'antfly.client_generated.api.api_table'

After:
$ uv run --with "antfly-sdk @ git+https://github.com/dovinmu/antfly-python.git@claude/fix-import-bug-NCnWk" python -c "import antfly; print('done')"

done

Bug #1: Fixed imports from non-existent api_table module

  • Changed imports to use correct paths: data_operations/batch_write,
    data_operations/lookup_key, and table_management/ for table ops

Bug #2: Fixed cast() misuse with BatchRequestInserts

  • cast() only hints types, doesn't convert data
  • Now properly creates BatchRequestInserts and
    BatchRequestInsertsAdditionalProperty model instances from dicts

Bug #3: Removed query method referencing non-existent endpoints

  • query_table and global_query don't exist in generated code
  • QueryRequest and QueryRequestFullTextSearch models don't exist
  • Removed the query method until proper endpoints are available

Bug #4 (Medium): Type mismatch - client.py creates Client but casts to AuthenticatedClient when calling APIs. Works at runtime but is a type safety issue.

Bug #5: observed /batch returning a 200 instead of 201 for single-document inserts

claude added 2 commits January 8, 2026 19:11
Bug antflydb#1: Fixed imports from non-existent api_table module
- Changed imports to use correct paths: data_operations/batch_write,
  data_operations/lookup_key, and table_management/ for table ops

Bug antflydb#2: Fixed cast() misuse with BatchRequestInserts
- cast() only hints types, doesn't convert data
- Now properly creates BatchRequestInserts and
  BatchRequestInsertsAdditionalProperty model instances from dicts

Bug antflydb#3: Removed query method referencing non-existent endpoints
- query_table and global_query don't exist in generated code
- QueryRequest and QueryRequestFullTextSearch models don't exist
- Removed the query method until proper endpoints are available
Bug #4: Fixed type mismatch with Client/AuthenticatedClient
- Created ApiClient type alias to document that both types work
- Removed cast() calls and added type: ignore comments
- Both Client and AuthenticatedClient have identical interfaces

HTTP status: Fixed batch_write to accept both 200 and 201
- Server returns 200 but generated code expected 201
- Now accepts either status code as success
@dovinmu dovinmu changed the title Fix critical import and type bugs in client.py Get antfly-sdk runnable Jan 9, 2026
@ajroetker

Copy link
Copy Markdown
Contributor

Oh I missed this sorry dude!! Thanks rowan, looks like there's a small merge conflict I can fix if you don't want to

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.

3 participants