'dynamic variable in pyspark dataframe

I have created dataframe using pyspark and trying to query based on dynamic variable, its giving empty rows.Can any help me to how pass dynamic variable in below query ?

start_dt = '2022-1-15'
df.printSchema()
-- state
--- county
--- population
---- pdate --- string

df = df.filter((df.state == 'CA') & (df.pdate == start_dt))
df.show()


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source