Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): record all operations that led to dataframe #548

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maartenbreddels
Copy link
Member

This POC solves several issues:

  • ALL operations can be recorded in the df.operation members: opening, joining, groupby etc
  • a dataframe can be serialized better, since it knows completely how it was constructed.

The state is still useful, but how they work together is something I need to think about.

Example operations serialized to json:

{
  "type": "transformation",
  "name": "add_virtual_column",
  "parameters": {
    "name": "r",
    "expression": "(__r + y)",
    "column_position": 10
  },
  "child": {
    "type": "transformation",
    "name": "rename_column",
    "parameters": {
      "old": "r",
      "new": "__r"
    },
    "child": {
      "type": "transformation",
      "name": "add_virtual_column",
      "parameters": {
        "name": "r",
        "expression": "(x + y)",
        "column_position": 10
      },
      "child": {
        "type": "source",
        "name": "open",
        "parameters": {
          "path": "/Users/maartenbreddels/src/vaex/data/helmi-dezeeuw-2000-10p.hdf5"
        }
      }
    }
  }
}

Which reflects this code:

df = vaex.open(path, execute=False)
df['r'] = df.x + df.y
df['r'] = df.r + df.y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant