I have the input data comes in below format which is in dataframe df_date:
col1, col2, extraction_date, col3
010, DSL, 20191201235900, VDRAC
010, DSL, 20191203235900, VDRAC
010, DSL, 20191205235900, VDRAC
010, DSL, 20200120235900, VDRAC
010, DSL, 20200128235900, VDRAC
010, DSL, 20200129235900, VDRAC
010, DSL, 20200129235900, VDRAC
(string, string, bitint(longtype), string) # I have added the data type of each column for reference)
When I want to process old date, consider only the records before 29th. I need to filter it and need to apply business condition.
import datetime
var = '28-01-2020'
ref_date = datetime.datetime.strptime(var, '%d-%m-%Y').date() #converting input ref date arg to date format
df_fil_date = df_data.filter(df_date.extraction_date.leq(ref_date))
Is showing me error, because the extraction_date from source is long_type (bitint) and the ref_date variable is in date format.
Could you please check and let me know how to filter the data based on the date variable passed?