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

TypeError: Expected tuple, got str #152

Open
polsinello opened this issue Jan 14, 2022 · 1 comment
Open

TypeError: Expected tuple, got str #152

polsinello opened this issue Jan 14, 2022 · 1 comment
Labels
more info needed when more info is needed from the person opening the issue

Comments

@polsinello
Copy link

polsinello commented Jan 14, 2022

When querying generation for Denmark and Slovenia (all other countries seem to work as expected) since 01/01/2016, i am encountering the following error using the pandas client:

client.query_generation('DK', start=pd.Timestamp('201601010000').tz_localize(area_mapping['DK'].tz), end=pd.Timestamp('202201010000').tz_localize(area_mapping['DK'].tz)).to_csv('DK_generation_per_type.csv')

4 frames
/usr/local/lib/python3.7/dist-packages/entsoe/decorators.py in year_wrapper(start, end, *args, **kwargs)
73 raise NoMatchingDataError
74
---> 75 df = pd.concat(frames, sort=True)
76 df = df.loc[~df.index.duplicated(keep='first')]
77 return df

/usr/local/lib/python3.7/dist-packages/pandas/core/reshape/concat.py in concat(objs, axis, join, ignore_index, keys, levels, names, verify_integrity, sort, copy)
285 )
286
--> 287 return op.get_result()
288
289

/usr/local/lib/python3.7/dist-packages/pandas/core/reshape/concat.py in get_result(self)
496 obj_labels = obj.axes[1 - ax]
497 if not new_labels.equals(obj_labels):
--> 498 indexers[ax] = obj_labels.reindex(new_labels)[1]
499
500 mgrs_indexers.append((obj._mgr, indexers))

/usr/local/lib/python3.7/dist-packages/pandas/core/indexes/multi.py in reindex(self, target, method, level, limit, tolerance)
2326 else:
2327 # hopefully?
-> 2328 target = MultiIndex.from_tuples(target)
2329
2330 if (

/usr/local/lib/python3.7/dist-packages/pandas/core/indexes/multi.py in from_tuples(cls, tuples, sortorder, names)
499 tuples = tuples._values
500
--> 501 arrays = list(lib.tuples_to_object_array(tuples).T)
502 elif isinstance(tuples, list):
503 arrays = list(lib.to_object_array_tuples(tuples).T)

pandas/_libs/lib.pyx in pandas._libs.lib.tuples_to_object_array()

TypeError: Expected tuple, got str

Any insight would be much appreciated
Thanks

@fboerman
Copy link
Collaborator

fboerman commented Mar 9, 2022

hi @polsinello thank you for your repport. thats really strange and a bit puzzling to me. Could you perhaps compare the xml output for slovenia with another country that doesnt have this problem? this seems to me like an issue with weird api response

@fboerman fboerman added the more info needed when more info is needed from the person opening the issue label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed when more info is needed from the person opening the issue
Projects
None yet
Development

No branches or pull requests

2 participants