From the course: Using Rust with Python
Unlock this course with a free trial
Join today to access over 23,200 courses taught by industry experts.
Polars CLI test in Rust - Rust Tutorial
From the course: Using Rust with Python
Polars CLI test in Rust
- [Presenter] Here we have a Rust Polars project that has all these components; Command line tool interface, benchmarking, integration tests, cargo, et cetera, but in my particular demo, I'm going to talk about unit tests. It's easy to maybe be complacent with a language like Rust because it's so safe and effective and every time you work on it, almost everything works. You still, though, need to write some kind of a business logic unit test because of the fact that things can change, right? The business logic can change and so you're building a contract so that you know exactly what's happening with your code so in the future, if you're making a small change, it doesn't, you know, create a problem down the road. So let's go ahead and take a look at how that works in Rust. So if we go over to this project here, Polars-cli, we can see that there's the source code, the library right here, and I'm going to go ahead and take a look at this function. So this is a public function calculate…
Contents
-
-
Introduction: Instructor45s
-
Introduction: Rust and Python5m
-
PyO3 installation4m 15s
-
(Locked)
Basic Rust library4m 46s
-
(Locked)
Rust to Python3m 33s
-
(Locked)
Rust ownership model4m 59s
-
(Locked)
Diagram of a PyO3 project3m 40s
-
(Locked)
Python calculator CLI3m 54s
-
(Locked)
PyO3 features2m 38s
-
(Locked)
PyO3 exceptions4m 21s
-
(Locked)
Call Python from Rust5m 53s
-
(Locked)
Run Python with embedded Rust4m 47s
-
(Locked)
Embedded Rust CLI diagram3m 34s
-
(Locked)
Embedded Rust CLI4m 31s
-
(Locked)
Embedded Rust CLI test4m 59s
-
(Locked)
Rust-built Python tools3m 52s
-
(Locked)
Using the Rust Ruff linter5m 15s
-
(Locked)
Using Polars in Python with Rust4m 9s
-
(Locked)
Polars CLI in Rust4m
-
(Locked)
Polars CLI test in Rust4m 21s
-
(Locked)
Polars CLI integration test3m 29s
-
(Locked)
Polars criterion benchmarking5m 39s
-