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

[C++][CI] example-cpp-tutorial fails because of deprecated APIs #44802

Closed
pitrou opened this issue Nov 21, 2024 · 7 comments
Closed

[C++][CI] example-cpp-tutorial fails because of deprecated APIs #44802

pitrou opened this issue Nov 21, 2024 · 7 comments

Comments

@pitrou
Copy link
Member

pitrou commented Nov 21, 2024

Describe the bug, including details regarding any error messages, version, and platform.

The example-cpp-tutorial Crossbow night build now fails because it's using some deprecated APIs.
https://github.com/ursacomputing/crossbow/actions/runs/11944262092/job/33294899404

It should certainly be easy to migrate the tested example(s) to non-deprecated APIs, and is therefore a good task for someone wanting to start on Arrow C++ development (or even perhaps general C++ development).

Component(s)

C++, Continuous Integration

@pitrou
Copy link
Member Author

pitrou commented Nov 21, 2024

@raulcd @assignUser

@malinjawi
Copy link
Contributor

hey @pitrou I am new to arrow. Will try to check this issue out. Look forward to learning about this project and getting a fix in for this.

@pitrou
Copy link
Member Author

pitrou commented Nov 21, 2024

@malinjawi So, if you look at the link I gave you above (the "Run" step in the failing CI run), you can easily reproduce the error locally if you have the Docker client installed, and run these commands:

$ cd arrow/cpp/examples/tutorial_examples
$ docker compose run --rm tutorial

@raulcd
Copy link
Member

raulcd commented Nov 21, 2024

@malinjawi btw this was the PR that introduced the change that has to be updated on the tutorial examples:

@malinjawi
Copy link
Contributor

hey @raulcd and @pitrou thanks for your help on this issue. I am very happy to raise my first PR to this project please if you can review and let me know if I missed something to fix this issue.

@kou
Copy link
Member

kou commented Nov 21, 2024

Oh, sorry.

I should have updated the file too...

kou added a commit that referenced this issue Nov 22, 2024
…:OpenFile() API` in example tutorials (#44807)

### Rationale for this change
This PR address this [issue](#44802) and updates the `example-cpp-tutorial` in Crossbow to resolve build failures caused by deprecated APIs, as seen in [this CI job](https://github.com/ursacomputing/crossbow/actions/runs/11944262092/job/33294899404). The change migrates the examples to non-deprecated APIs to ensure compatibility with the latest Arrow C++ version.

Updating these APIs is necessary to:

Fix build failures and prevent future issues.
Align with the current Arrow C++ API.

### What changes are included in this PR?

This PR updates the example-cpp-tutorial to replace deprecated Arrow C++ APIs with the latest supported APIs, resolving build failures in the Crossbow night build.

### Are these changes tested?

By running: 
```
$ cd arrow/cpp/examples/tutorial_examples
$ docker compose run --rm tutorial
```

output:
```==
== Running example project
==

Day:   [
    1,
    12,
    17,
    23,
    28
  ]
Month:   [
    1,
    3,
    5,
    7,
    1
  ]
Year:   [
    1990,
    2000,
    1995,
    2000,
    1995
  ]
Day: int8
Month: int8
Year: int16
----
Day:
  [
    [
      1,
      12,
      17,
      23,
      28
    ],
    [
      6,
      12,
      3,
      30,
      22
    ]
  ]
Month:
  [
    [
      1,
      3,
      5,
      7,
      1
    ],
    [
      5,
      4,
      11,
      3,
      2
    ]
  ]
Year:
  [
    [
      1990,
      2000,
      1995,
      2000,
      1995
    ],
    [
      1980,
      2001,
      1915,
      2020,
      1996
    ]
  ]
Datum kind: Scalar(12891) content type: int64
12891
Datum kind: ChunkedArray([
  [
    75376,
    647,
    2287,
    5671,
    5092
  ]
]) content type: int32
[
  [
    75376,
    647,
    2287,
    5671,
    5092
  ]
]
Datum kind: Scalar(2) content type: int64
2
Found fragment: parquet_dataset/data1.parquet
Partition expression: true
Found fragment: parquet_dataset/data2.parquet
Partition expression: true
a: int64
b: int64
c: int64
----
a:
  [
    [
      0,
      1,
      2,
      3,
      4
    ],
    [
      5,
      6,
      7,
      8,
      9
    ]
  ]
b:
  [
    [
      9,
      8,
      7,
      6,
      5
    ],
    [
      4,
      3,
      2,
      1,
      0
    ]
  ]
c:
  [
    [
      1,
      2,
      1,
      2,
      1
    ],
    [
      2,
      1,
      2,
      1,
      2
    ]
  ]

```

### Are there any user-facing changes?

Yes, the tutorial has been updated to use non-deprecated APIs, which may affect the example code provided to users.

* GitHub Issue: #44802

Lead-authored-by: Mohammad Linjawi <[email protected]>
Co-authored-by: Mohammad Linjawi <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
@kou kou added this to the 19.0.0 milestone Nov 22, 2024
@kou
Copy link
Member

kou commented Nov 22, 2024

Issue resolved by pull request 44807
#44807

@kou kou closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants