Chavithra / degiro-connector

This is yet another library to access Degiro's API.
BSD 3-Clause "New" or "Revised" License
215 stars 47 forks source link

map_elements function without return_dtype in ticker_to_df #140

Closed lucaga closed 4 months ago

lucaga commented 4 months ago

Thanks for this amazing code and its documentation.

A question, while testing the realtime_poller example, the dataframe is created by ticker_to_py.

the functions
add_request_duration_column add_response_datetime_column use the method .map_elements. Since the argument return_dtype is not specified, it returns a warning:

MapWithoutReturnDtypeWarning: Callingmap_elementswithout specifyingreturn_dtypecan lead to unpredictable results. Specifyreturn_dtypeto silence this warning.

When adding the dtype the warning goes away, though it leaves me asking what other consequences might happen. It seems that the variable that is going to be written is well defined and confined by the scope of the function.

What would be against specifying the return_dtype?

Chavithra commented 4 months ago

Hi @lucaga,

I guess the right type for these columns is pl.Datetime.

For the impact let's see.

PR are welcome !

Thanks for this feedback

lucaga commented 4 months ago

PR is done.