Skip to content

Commit

Permalink
remove Python package, drop Elasticsearch 1.0.3 support, get CI worki…
Browse files Browse the repository at this point in the history
…ng again (#224)
  • Loading branch information
jameslamb authored Jan 11, 2025
1 parent 838448b commit 718b01f
Show file tree
Hide file tree
Showing 28 changed files with 65 additions and 1,145 deletions.
4 changes: 0 additions & 4 deletions .ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ if [[ "$TASK" == "rpkg" ]]; then
--clean \
$(pwd)/r-pkg
fi

if [[ "$TASK" == "pypkg" ]]; then
pip install $(pwd)/py-pkg
fi
36 changes: 18 additions & 18 deletions .ci/lint_r_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ interactive_text <- paste0(
)

LINTERS_TO_USE <- list(
"absolute_path" = lintr::absolute_path_linter
, "assignment" = lintr::assignment_linter
, "closed_curly" = lintr::closed_curly_linter
, "commas" = lintr::commas_linter
, "equals_na" = lintr::equals_na_linter
, "function_left" = lintr::function_left_parentheses_linter
, "infix_spaces" = lintr::infix_spaces_linter
, "no_tabs" = lintr::no_tab_linter
, "non_portable_path" = lintr::nonportable_path_linter
, "open_curly" = lintr::open_curly_linter
, "semicolon" = lintr::semicolon_terminator_linter
, "seq" = lintr::seq_linter
, "spaces_inside" = lintr::spaces_inside_linter
, "spaces_left_parens" = lintr::spaces_left_parentheses_linter
# "absolute_path" = lintr::absolute_path_linter()
"assignment" = lintr::assignment_linter()
# , "closed_curly" = lintr::closed_curly_linter()
, "commas" = lintr::commas_linter()
, "equals_na" = lintr::equals_na_linter()
, "function_left" = lintr::function_left_parentheses_linter()
, "infix_spaces" = lintr::infix_spaces_linter()
, "no_tabs" = lintr::no_tab_linter()
# , "non_portable_path" = lintr::nonportable_path_linter()
# , "open_curly" = lintr::open_curly_linter()
, "semicolon" = lintr::semicolon_terminator_linter()
, "seq" = lintr::seq_linter()
, "spaces_inside" = lintr::spaces_inside_linter()
, "spaces_left_parens" = lintr::spaces_left_parentheses_linter()
, "todo_comments" = lintr::todo_comment_linter(c("todo", "fixme", "to-do"))
, "trailing_blank" = lintr::trailing_blank_lines_linter
, "trailing_white" = lintr::trailing_whitespace_linter
, "true_false" = lintr::T_and_F_symbol_linter
, "trailing_blank" = lintr::trailing_blank_lines_linter()
, "trailing_white" = lintr::trailing_whitespace_linter()
, "true_false" = lintr::T_and_F_symbol_linter()
, "undesirable_function" = lintr::undesirable_function_linter(
fun = c(
"cbind" = paste0(
Expand All @@ -72,7 +72,7 @@ LINTERS_TO_USE <- list(
, "??" = interactive_text
)
)
, "unneeded_concatenation" = lintr::unneeded_concatenation_linter
, "unneeded_concatenation" = lintr::unneeded_concatenation_linter()
)

cat(sprintf("Found %i R files to lint\n", length(FILES_TO_LINT)))
Expand Down
4 changes: 0 additions & 4 deletions .ci/report_to_covr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ if [[ "$TASK" == "rpkg" ]]; then
covr::codecov('r-pkg/') \
"
fi

if [[ "$TASK" == "pypkg" ]]; then
echo "This is a Python build. No post-build actions configured."
fi
7 changes: 0 additions & 7 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,3 @@ if [[ "$TASK" == "rpkg" ]]; then
--as-cran \
*.tar.gz
fi

if [[ "$TASK" == "pypkg" ]]; then
pip install wheel
pytest \
--verbose \
$(pwd)/py-pkg
fi
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# Default reviewers for all code
* @jameslamb @austin3dickey

# Python package
py-pkg/* @ngparas @jameslamb @austin3dickey

# community files
LICENSE @jameslamb @austin3dickey @bburns632
CONDUCT.md @jameslamb @austin3dickey @bburns632
51 changes: 3 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
#---#
# R #
#---#
- task: rpkg
es_version: 1.0.3
- task: rpkg
es_version: 1.7.6
- task: rpkg
Expand Down Expand Up @@ -56,62 +54,19 @@ jobs:
es_version: 7.11.2
- task: rpkg
es_version: 7.12.1
#--------#
# python #
#--------#
- task: pypkg
es_version: 1.0.3
- task: pypkg
es_version: 1.7.6
- task: pypkg
es_version: 2.4.6
- task: pypkg
es_version: 5.6.16
- task: pypkg
es_version: 6.0.1
- task: pypkg
es_version: 6.8.15
- task: pypkg
es_version: 7.1.1
- task: pypkg
es_version: 7.2.1
- task: pypkg
es_version: 7.3.2
- task: pypkg
es_version: 7.4.2
- task: pypkg
es_version: 7.5.2
- task: pypkg
es_version: 7.6.2
- task: pypkg
es_version: 7.7.1
- task: pypkg
es_version: 7.8.1
- task: pypkg
es_version: 7.9.3
- task: pypkg
es_version: 7.10.2
- task: pypkg
es_version: 7.11.2
- task: pypkg
es_version: 7.12.1
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: set up R
if: matrix.task == 'rpkg'
uses: r-lib/actions/setup-r@v1
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.1.0'
r-version: release
- name: set up pandoc
if: matrix.task == 'rpkg'
uses: r-lib/actions/setup-pandoc@v1
- name: set up python
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.7
uses: r-lib/actions/setup-pandoc@v2
- name: run tests
shell: bash
run: |
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ r-pkg/inst/testdata/*.json
**/dist/
**/htmlcov/
**/*.egg-info/
py-pkg/LICENSE
py-pkg/NEWS.md
py-pkg/README.md
py-pkg/docs/_build

# As long as we're storing the pkgdown site
# at the repo root, should protect against
Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Each build actually runs many sub-builds. Those sub-builds run once for each com
* programming language
* Elasticsearch version

As of this writing, this project has clients in two programming languages: [R](./r-pkg) and [Python](./py-pkg).
As of this writing, this project has clients in one programming language: [R](./r-pkg).

The set of Elasticsearch versions this project tests against changes regularly as [new Elasticsearch versions are released](https://www.elastic.co/downloads/past-releases#elasticsearch). The strategy in this project is to test against the following Elasticsearch versions:

Expand All @@ -87,9 +87,8 @@ The set of Elasticsearch versions this project tests against changes regularly a
> `uptasticsearch` may be tested against specific additional intermediate versions if bugs are found in the interaction between `uptasticsearch` and those versions
So, for example, as of September 2020 that meant we tested against:
So, for example, as of January 2025 that meant we tested against:

* 1.0.3
* 1.7.6
* 2.4.6
* 5.6.16
Expand All @@ -109,7 +108,9 @@ So, for example, as of September 2020 that meant we tested against:
* 7.11.2
* 7.12.1

You may notice that this strategy means that `uptasticsearch` is tested for backwards compatibility with Elasticsearch versions which have already reached [End-of-Life](https://www.elastic.co/support/eol). For example, support for Elasticsearch 1.7.x officially ended in January 2017. We test these old versions because we know of users whose companies still run those versions, and for whom Elasticsearch upgrades are prohibitively expensive. In general, upgrades across major versions pre-6.x [require a full cluster restart](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html).
You may notice that this strategy means that `uptasticsearch` is tested for backwards compatibility with Elasticsearch versions which have already reached [End-of-Life](https://www.elastic.co/support/eol). For example, support for Elasticsearch 1.7.x officially ended in January 2017.
We test these old versions because we know of users whose companies still run those versions, and for whom Elasticsearch upgrades are prohibitively expensive.
In general, upgrades across major versions pre-6.x [require a full cluster restart](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html).

### Running Tests Locally <a name="testing-local"></a>

Expand Down
24 changes: 1 addition & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build_r coverage_r docs_r install_r test_r build_py docs_py install_py test_py gh_pages
.PHONY: build_r coverage_r docs_r install_r test_r gh_pages

#####
# R #
Expand Down Expand Up @@ -26,28 +26,6 @@ install_r: build_r
test_r: build_r
R CMD CHECK --as-cran uptasticsearch_*.tar.gz

##########
# Python #
##########

build_py:
cp LICENSE py-pkg/
cp NEWS.md py-pkg/
cp README.md py-pkg/

docs_py:
# Create sphinx rst files for every package and subpackage
cd py-pkg && \
sphinx-apidoc -f -F -e -o docs uptasticsearch && \
cd docs && \
make html

install_py:
pip install py-pkg/

test_py:
pytest py-pkg/

###########
# General #
###########
Expand Down
85 changes: 38 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

## Introduction

`uptasticsearch` tackles the issue of getting data out of Elasticsearch and into a tabular format in R and Python. It should work for all versions of Elasticsearch from 1.0.0 onwards, but [is not regularly tested against all of them](https://github.com/uptake/uptasticsearch/blob/master/CONTRIBUTING.md#gha). If you run into a problem, please [open an issue](https://github.com/uptake/uptasticsearch/issues).
`uptasticsearch` tackles the issue of getting data out of Elasticsearch and into a tabular format in R. It should work for all versions of Elasticsearch from 1.0.0 onwards, but [is not regularly tested against all of them](https://github.com/uptake/uptasticsearch/blob/master/CONTRIBUTING.md#gha). If you run into a problem, please [open an issue](https://github.com/uptake/uptasticsearch/issues).

# Table of contents

* [How it Works](#howitworks)
* [Installation](#installation)
* [R](#rinstallation)
* [Python](#pythoninstallation)
* [Usage Examples](#examples)
* [Get a Batch of Documents](#example1)
* [Aggregation Results](#example2)
Expand Down Expand Up @@ -53,17 +52,6 @@ remotes::install_github(
)
```

### Python <a name="pythoninstallation"></a>

![Lifecycle Dormant](https://img.shields.io/badge/lifecycle-dormant-orange.svg)

This package is not currently available on PyPi. To build the development version from source, clone this repo, then :

```shell
cd py-pkg
pip install .
```

## Usage Examples <a name="examples"></a>

The examples presented here pertain to a fictional Elasticsearch index holding some information on a movie theater business.
Expand Down Expand Up @@ -170,37 +158,40 @@ revenueDT <- es_search(
)
```

In the example above, we used the [date_histogram](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html) and [extended_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html) aggregations. `es_search()` has built-in support for many other aggregations and combinations of aggregations, with more on the way. Please see the table below for the current status of the package. Note that names of the form "agg1 - agg2" refer to the ability to handled aggregations nested inside other aggregations.

|Agg type | R support? | Python support? |
|:--------------------------------------------|:-----------:|:----------------:|
|["cardinality"](http://bit.ly/2sn5Qiw) |YES |NO |
|["date_histogram"](http://bit.ly/2qIR97Z) |YES |NO |
|date_histogram - cardinality |YES |NO |
|date_histogram - extended_stats |YES |NO |
|date_histogram - histogram |YES |NO |
|date_histogram - percentiles |YES |NO |
|date_histogram - significant_terms |YES |NO |
|date_histogram - stats |YES |NO |
|date_histogram - terms |YES |NO |
|["extended_stats"](http://bit.ly/2qKqsDU) |YES |NO |
|["histogram"](http://bit.ly/2sn4LXF) |YES |NO |
|["percentiles"](http://bit.ly/2sy4z7f) |YES |NO |
|["significant terms"](http://bit.ly/1KnhT1r) |YES |NO |
|["stats"](http://bit.ly/2sn1t74) |YES |NO |
|["terms"](http://bit.ly/2mJyQ0C) |YES |NO |
|terms - cardinality |YES |NO |
|terms - date_histogram |YES |NO |
|terms - date_histogram - cardinality |YES |NO |
|terms - date_histogram - extended_stats |YES |NO |
|terms - date_histogram - histogram |YES |NO |
|terms - date_histogram - percentiles |YES |NO |
|terms - date_histogram - significant_terms |YES |NO |
|terms - date_histogram - stats |YES |NO |
|terms - date_histogram - terms |YES |NO |
|terms - extended_stats |YES |NO |
|terms - histogram |YES |NO |
|terms - percentiles |YES |NO |
|terms - significant_terms |YES |NO |
|terms - stats |YES |NO |
|terms - terms |YES |NO |
In the example above, we used the [date_histogram](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html) and [extended_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html) aggregations.
`es_search()` has built-in support for many other aggregations and combinations of aggregations, with more on the way.
Please see the table below for the current status of the package.
Note that names of the form "agg1 - agg2" refer to the ability to handled aggregations nested inside other aggregations.

|Agg type | R support? |
|:--------------------------------------------|:-----------:|
|["cardinality"](http://bit.ly/2sn5Qiw) |YES |
|["date_histogram"](http://bit.ly/2qIR97Z) |YES |
|date_histogram - cardinality |YES |
|date_histogram - extended_stats |YES |
|date_histogram - histogram |YES |
|date_histogram - percentiles |YES |
|date_histogram - significant_terms |YES |
|date_histogram - stats |YES |
|date_histogram - terms |YES |
|["extended_stats"](http://bit.ly/2qKqsDU) |YES |
|["histogram"](http://bit.ly/2sn4LXF) |YES |
|["percentiles"](http://bit.ly/2sy4z7f) |YES |
|["significant terms"](http://bit.ly/1KnhT1r) |YES |
|["stats"](http://bit.ly/2sn1t74) |YES |
|["terms"](http://bit.ly/2mJyQ0C) |YES |
|terms - cardinality |YES |
|terms - date_histogram |YES |
|terms - date_histogram - cardinality |YES |
|terms - date_histogram - extended_stats |YES |
|terms - date_histogram - histogram |YES |
|terms - date_histogram - percentiles |YES |
|terms - date_histogram - significant_terms |YES |
|terms - date_histogram - stats |YES |
|terms - date_histogram - terms |YES |
|terms - extended_stats |YES |
|terms - histogram |YES |
|terms - percentiles |YES |
|terms - significant_terms |YES |
|terms - stats |YES |
|terms - terms |YES |
20 changes: 0 additions & 20 deletions py-pkg/Makefile

This file was deleted.

20 changes: 0 additions & 20 deletions py-pkg/docs/Makefile

This file was deleted.

Loading

0 comments on commit 718b01f

Please sign in to comment.