'Window function not able to capture all rows, skipping the row with value 'null' [duplicate]

My window function is not capturing the first row with "Rate" = null. As there is only one country code there should be single window right? The expected output should be 20.519 for column "New" in all rows.

from pyspark.sql.functions import first
from pyspark.sql.window import Window
W = Window.partitionBy(DF.Country).orderBy(DF.Date.desc())
DF.select("*",first("Exchange_Rate",ignorenulls=True).over(W))

Dataset



Sources

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

Source: Stack Overflow

Solution Source