cloudflare-python icon indicating copy to clipboard operation
cloudflare-python copied to clipboard

TypeError in ```dns_timeseries_response.py``` due to circular import

Open MohammadHashmi opened this issue 6 months ago • 0 comments

Confirm this is a Python library issue and not an underlying Cloudflare API issue.

  • [x] This is an issue with the Python library

Describe the bug

This is the complete error I am getting: ImportError: cannot import name 'UnnamedTypeWithobjectParent0UnnamedTypeWithobjectParent0Item' from partially initialized module 'cloudflare.types.radar.dns_timeseries_response' (most likely due to a circular import)

I am attempting to use a function that interacts with Cloudflare's Radar API, specifically a method that returns a dns_timeseries_response object. The exact function call is not relevant, as the error occurs upon module import, not function execution. I am not directly importing UnnamedTypeWithobjectParent0UnnamedTypeWithobjectParent0Item.

To Reproduce

Create a Python environment.

Install the cloudflare-python library: pip install cloudflare

Try to use any method that returns cloudflare.types.radar.dns_timeseries_response. For example, this could be a call to a Radar API endpoint.

I've added the code that is giving me an error below


client = Cloudflare(
    api_token=token,
    )

response = client.radar
'''print(response.meta)'''

Code snippets


OS

Windows 11

Python version

3.13.5

Library version

v4.3.1

MohammadHashmi avatar Aug 26 '25 01:08 MohammadHashmi