Discussions
Downloading with deweypy and duckdb error
yesterday by jeremy
I'm trying to follow the tutorial text on this page: https://docs.deweydata.io/docs/using-duckdb-with-dewey to filter a dataset prior to downloading, but calling get_dataset_files produces an error: "httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol." My code follows what's on the tutorial page:
import duckdb
import polars as pl
import os
from deweypy.auth import set_api_key
from deweypy.download.synchronous import get_dataset_files
api_key = os.environ["DEWEY_API_KEY"]
data_id = "https://api.deweydata.io/api/v1/external/data/prj_ya8wbf3v__fldr_cggezfmh4zsrfevk8"
set_api_key(api_key) # Pass API key here to authenticate future requests
urls = get_dataset_files(data_id,
partition_key_after = "2020-01-01",
partition_key_before ="2020-12-31",
to_list=True)
urls[:10]
My api key is set properly, as I can use it to download a smaller dataset directly via the dewey client. What am I doing wrong?