Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some features that makes use of manifest files #17

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

altescy
Copy link
Contributor

@altescy altescy commented Oct 26, 2023

This PR add some features that makes use of manifest files:

Utilizing manifest files

  • Add use_manifest option to QueueryClient
  • If a manifest file is set to available (when use_manifest=True or enable_cast=True):
    • a manifest file is automatically downloaded before fetching data
    • a pandas.DataFrame returned by read(use_pandas=True) has column names according to the manifest
    • an iterator returned by __iter__(...) can be Sized object with the record count

map() method

In addition, map() method is added to Response and can be used as follows:

@dataclasses.dataclass
class Item:
    id: int
    title: str


client = QueueryClient(enable_cast=True)
response = client.run("select id, title from your_table")

for item in response.map(Item):
    assert isinstance(item, Item)

@altescy altescy merged commit 017de38 into bricolages:main Oct 26, 2023
4 checks passed
@altescy altescy deleted the use-manifest branch October 26, 2023 06:31
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