Skip to content

Remove interactive prompts from the package #27

@dpavam

Description

@dpavam

Remove interactive prompts when users attempt a very large request. This is to improve agentic usage.

# If the number of results is small enough and download is off, it's okay to show as df
if num_results < 1000000 and not download:
return _batch_to_df(core, params, num_results)
# If it's too big, warn the user and ask if they want to proceed.
else:
print(
"Your request might exceed the available memory. We suggest setting 'download=True' and reading the file in batches"
)
prompt = input(
"Do you wish to proceed anyway? press ('y' or enter to proceed) / type('n' or 'exit' to cancel)"
)
match prompt:
case "n" | "exit":
print("Exiting gracefully")
exit()
case "y" | "":
print("Fetching data...")
return _batch_to_df(core, params, num_results)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions