Skip to content

Migrate logical_plan tests to insta #15792

@blaginin

Description

@blaginin

In #15178, we're switching hard-coded constants in tests to insta.

This issue targets updating logical_plan tests (datafusion/expr/src/logical_plan).

Examples of tests that need to be switched to insta

  • {
    "Plan": {
    "Expressions": [
    "employee_csv.id"
    ],
    "Node Type": "Projection",
    "Output": [
    "id"
    ],
    "Plans": [
    {
    "Condition": "employee_csv.state IN (<subquery>)",
    "Node Type": "Filter",
    "Output": [
  • let expected = "\
    Distinct:\
    \n Union\
    \n Distinct:\
    \n Union\
    \n Distinct:\
    \n Union\
    \n TableScan: employee_csv projection=[state, salary]\
    \n TableScan: employee_csv projection=[state, salary]\
  • Debatable, but I think we should also update doc tests, e.g.
    /// assert_eq!(
    /// "Filter: t1.id = Int32(3)\
    /// \n TableScan: t1",
    /// plan.display_indent().to_string()
    - although that said, we should keep doc tests as simple as possible and easy to reproduce for the users. Feel free to write your thoughts on that before submitting the PR so we can discuss it.
    ... and so on - check assert_eq! format!("{plan}"), TableScan:

Check the original issue for tips on how to do the switch and examples of completed PRs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions