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

Implement minimal API #1

Merged
merged 1 commit into from
Jun 3, 2022
Merged

Implement minimal API #1

merged 1 commit into from
Jun 3, 2022

Conversation

kou
Copy link
Member

@kou kou commented Jun 3, 2022

@kou
Copy link
Member Author

kou commented Jun 3, 2022

edition = "2021"
rust-version = "1.59"
exclude = [
"/cpp/",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this ignored?

Copy link
Member Author

@kou kou Jun 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cpp/ is just for reusing archery in apache/arrow. It's not needed for packaging.
See also the comment in cpp/CMakeLists.txt: https://github.com/datafusion-contrib/datafusion-c/pull/1/files#diff-1bba462ab050e89360fd88110a689e85ee037749cea091a1848ab574381d3795R18

# This is just for mimicking apache/arrow repository to use "archery lint --rat".

C example:

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```bash
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

datafusion.df_data_frame_show.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
datafusion.df_data_frame_show.restype = None

context = datafusion.df_session_context_new()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if this can be used with context manager

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do it but I think that we shouldn't do it. I want to keep the example as simple as possible to show how to use FFI features to use this C API. The example isn't intended to be used by users directly. (Python users should use datafusion-python instead.)

@jimexist jimexist merged commit d7b78e6 into datafusion-contrib:main Jun 3, 2022
@jimexist
Copy link
Contributor

jimexist commented Jun 3, 2022

i merged this as-is. there are some possibility of improvements but it can happen in subsequent pull requests as the GitHub action needs to be in effect first.

@kou kou deleted the import branch June 4, 2022 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants