Theilsen function use to determine the change of certain variable over the specified time horizon

Does df contain a field called date with the correct format? Can you provide a reproducible example with a minimal dataset the reproduces that problem?