degiro-connector icon indicating copy to clipboard operation
degiro-connector copied to clipboard

map_elements function without return_dtype in ticker_to_df

Open lucaga opened this issue 1 year ago • 2 comments

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: Calling map_elementswithout specifyingreturn_dtypecan lead to unpredictable results. Specifyreturn_dtype to 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?

lucaga avatar May 13 '24 10:05 lucaga

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

Chavithra avatar May 13 '24 11:05 Chavithra

PR is done.

lucaga avatar May 14 '24 00:05 lucaga