mrpowers-io / quinn

pyspark methods to enhance developer productivity 📣 👯 🎉
https://mrpowers-io.github.io/quinn/
Apache License 2.0
642 stars 99 forks source link

ENH: Add beginning of month and end of month functions #266

Open MrPowers opened 1 month ago

MrPowers commented 1 month ago

Feature Type

Problem Description

Kind of weird syntax to compute beginning and end of month:

Screenshot 2024-09-24 at 4 53 22 PM

Feature Description

Add beginning_of_month and end_of_month functions that are easier to read.

Additional Context

Article on how to do this with Spark Scala: https://mungingdata.com/apache-spark/start-end-month-last-day-date-trunc/

SemyonSinchenko commented 1 month ago

The last day already exists in pyspark

https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.last_day.html

nijanthanvijayakumar commented 1 month ago

Is this enhancement still required @SemyonSinchenko ?

If so, can the end_of_month function be built on top of last_day function in Spark? And if that's the ask, can I take this up?