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

added csv to driver list #106

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

added csv to driver list #106

wants to merge 5 commits into from

Conversation

kthyng
Copy link

@kthyng kthyng commented Aug 26, 2021

I have run this successfully in my local version but I am not sure how to best demonstrate that here. Could I get some help with this process and what you'd like to see?

@kthyng kthyng mentioned this pull request Aug 26, 2021
@kthyng
Copy link
Author

kthyng commented Aug 26, 2021

Since I am going through this process anyway, I thought I'd add in opendap too. Might come in handy.

@scottyhq
Copy link
Collaborator

thanks @kthyng!

If you could please add a small test that demonstrates opening the csv from a STAC item here that would be great

You can add an 'item_csv.json' in this folder https://github.com/intake/intake-stac/tree/main/intake_stac/tests/data/1.0.0 with an accompanying data file.

intake_stac/catalog.py Outdated Show resolved Hide resolved
@kthyng
Copy link
Author

kthyng commented Sep 17, 2021

@scottyhq I added a sample csv file and an accompanying item json file. I tried to set up a test (line 240 in test_catalog.py) but I couldn't guess enough about how it worked to figure it out. Can you provide any guidance on setting up the test?

@scottyhq
Copy link
Collaborator

Apologies for leaving this so long @kthyng! I think we can get it merged soon, just need to resolve the conflicts (click 'Resolve Conflicts' button below and just delete the <<< === >>> lines b/c we want to keep both your new test and the recent changes). For the test, here is an example to confirm the correct driver is used and we get back a pandas: dataframe

cat = intake.open_stac_item('item-csv.json')
df = cat['test'].read()

assert cat['test'].metadata['type'] == 'text/csv'
assert isinstance(cat['test'], intake.source.csv.CSVSource)
assert isinstance(df, pandas.dataframe.core.DataFrame) 

you'll likely have to modify the path to item-csv.json, see other examples at the top of the test script

here = Path(__file__).parent
cat_url = str(here / 'data/1.0.0/catalog/catalog.json')

@kthyng
Copy link
Author

kthyng commented Oct 21, 2021

Thanks @scottyhq! I should be able to get back to this later next week if not before. I appreciate your help!

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.

None yet

2 participants