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

Support relative paths #76

Closed
lars-reimann opened this issue Apr 3, 2024 · 1 comment · Fixed by #83
Closed

Support relative paths #76

lars-reimann opened this issue Apr 3, 2024 · 1 comment · Fixed by #83
Assignees
Labels
enhancement 💡 New feature or request released Included in a release

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Apr 3, 2024

Is your feature request related to a problem?

I have two files in my VS Code workspace next to each other:

  • test.sdstest
  • titanic.csv

However, I must load the CSV file using an absolute path. This makes exchanging runnable code impossible.

package test

pipeline myPipeline {
    val titanic = Table.fromCsvFile("C:/Users/Lars/OneDrive/Desktop/test/titanic.csv");
}

Using relative paths leads to an error when executing test.sdstest:

package test

pipeline myPipeline {
    val titanic = Table.fromCsvFile("titanic.csv");
}
2024-04-03 17:54:59.561 [info] [Runner] Message received: '{"type": "runtime_error", "id": "4eabb3d8-fc98-4875-89ce-e7580fb519e5", "data": {"message": "File \"titanic.csv\" does not exist<truncated>'

Desired solution

Possible solution:

  • Add a field currentWorkingDirectory to the program message.
  • Use this when spawning the Python process for execution.
  • In the DSL: When invoking the runner, set the currentWorkingDirectory to the directory that contains the file we execute.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label Apr 3, 2024
@lars-reimann lars-reimann self-assigned this Apr 10, 2024
@lars-reimann lars-reimann linked a pull request Apr 10, 2024 that will close this issue
WinPlay02 pushed a commit that referenced this issue Apr 10, 2024
Closes #76

### Summary of Changes

The `cwd` of the worker process can now be set via the new `data.cwd`
item of the `program` message.

---------

Co-authored-by: megalinter-bot <[email protected]>
lars-reimann pushed a commit that referenced this issue Apr 10, 2024
## [0.10.0](v0.9.0...v0.10.0) (2024-04-10)

### Features

* support relative paths ([#83](#83)) ([a65261b](a65261b)), closes [#76](#76)
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request released Included in a release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant