You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by yj...@apache.org on 2023/04/13 12:12:25 UTC
[arrow-datafusion] branch main updated: minor: fix doctest that runs accidentally (#5989)
This is an automated email from the ASF dual-hosted git repository.
yjshen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new a55d805e55 minor: fix doctest that runs accidentally (#5989)
a55d805e55 is described below
commit a55d805e550492707ef64c1258c9f08ad1d09008
Author: Yijie Shen <he...@gmail.com>
AuthorDate: Thu Apr 13 20:12:20 2023 +0800
minor: fix doctest that runs accidentally (#5989)
* minor: fix doctest that runs accidentally
* enable doctest in ci for docs/**
* separate yaml for doctest
---
.github/workflows/docs_pr.yaml | 54 +++++++++++++++++++++++++++++++++
docs/source/user-guide/example-usage.md | 5 +--
2 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/docs_pr.yaml b/.github/workflows/docs_pr.yaml
new file mode 100644
index 0000000000..435006ed93
--- /dev/null
+++ b/.github/workflows/docs_pr.yaml
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Docs
+
+concurrency:
+ group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
+ cancel-in-progress: true
+
+on:
+ push:
+ paths:
+ - "docs/**"
+ pull_request:
+ paths:
+ - "docs/**"
+ # manual trigger
+ # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
+ workflow_dispatch:
+
+jobs:
+ # Run doc tests
+ linux-test-doc:
+ name: cargo doctest (amd64)
+ runs-on: ubuntu-latest
+ container:
+ image: amd64/rust
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup-builder
+ with:
+ rust-version: stable
+ # Note: this does not include dictionary_expressions to reduce codegen
+ - name: Run doctests
+ run: cargo test --doc --features avro,jit,scheduler,json
+ - name: Verify Working Directory Clean
+ run: git diff --exit-code
diff --git a/docs/source/user-guide/example-usage.md b/docs/source/user-guide/example-usage.md
index fd3c4cf183..d8e7e3c882 100644
--- a/docs/source/user-guide/example-usage.md
+++ b/docs/source/user-guide/example-usage.md
@@ -175,12 +175,13 @@ codegen-units = 1
Then, in `main.rs.` update the memory allocator with the below after your imports:
-```rust
+```rust,ignore
use datafusion::prelude::*;
#[global_allocator]
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
+#[tokio::main]
async fn main() -> datafusion::error::Result<()> {
Ok(())
}
@@ -195,6 +196,6 @@ rustup toolchain install nightly
Based on the instruction set architecture you are building on you will want to configure the `target-cpu` as well, ideally
with `native` or at least `avx2`.
-```
+```shell
RUSTFLAGS='-C target-cpu=native' cargo +nightly run --release
```