**See [Datafusion 39.0.0 Changelog](https://github.com/apache/datafusion/blob/c50f0dc6ef602bd7780bdfd18ef2905e8659ee96/dev/changelog/39.0.0.md)** - [x] Minimal upgrade of `datafusion` to get to compiling and passing tests - [x] #670 - [x] #677 - [x] #665 - [x] And any straggling Dependabot PRs - [x] New features to port **Please let me know if you want something** - [x] ? complete [pyo3 migration to bounds api](https://github.com/PyO3/pyo3/releases/tag/v0.21.0) #734 - [x] functions `first_value` and `last_value` need to accept a `sqlparser::ast::NullTreatment`