Null values in non-null cells should normally not happen, but sometimes they do and
we shouldn't fail miserably in those cases.
Closes#2880.
Co-authored-by: Tom Morris <tfmorris@gmail.com>
* Update test to demonstrate retry mechanism for recon queries.
This was fixed earlier by #3237. Closes#3369.
* Ensure non-zero retry interval in HttpClient
* Restore original bound
* build(deps): bump butterfly from 1.0.4 to 1.1.0
Bumps [butterfly](https://github.com/OpenRefine/simile-butterfly) from 1.0.4 to 1.1.0.
- [Release notes](https://github.com/OpenRefine/simile-butterfly/releases)
- [Commits](https://github.com/OpenRefine/simile-butterfly/commits)
Signed-off-by: dependabot[bot] <support@github.com>
* Update Butterfly configuration after Jetty upgrade
* Fix main class name in web.xml
* Upgrade Butterfly to Jetty 9
* Temporary debugging output to understand why RefineServlet is not found
* Upgrade servlet-api
* Fix javax.servlet-api artifactId
* Reinstate debug logging temporarily
* Update butterfly to 1.1.1 to solve servlet-api version conflict
* Update javax.servlet-api in the rest of the code base
* Silence server logs in ./refine ui_test again
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Improvements to GREL Help text in-tool and minor updates to GREL reference. Plus removal of pointless tests
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-authored-by: Owen Stephens <owen@ostephens.com>
* Refactor HTTP code into a common utility class
Centralizes the six (slightly) different implementations to use
a common Apache HTTP Client 5 implementation which implements our
strategies for retries, timeouts, error handling, etc.
Apache HTTP Client 5 adds support for Retry-After headers, HTTP/2,
and a bunch of other stuff under the covers.
Moves request delay to a request interceptor and fixes calculation
of the delay (again). Increase retries from 1x to 3x and use delay*2
as the default retry interval, if no Retry-After header. Uses an
exponential backoff strategy for multiple retries.
* Reuses HTTP client across requests
* Use IOException instead of Exception for HTTP errors
* Fix: Preventing addition of any empty cells with whitespaces while importing Xml data with Tests : Issue #1095
* Chore: Using 'CharMatcher' to match whitespace pattern instead of using custom regex : Issue #1095
* add clarity for reinterpret docs
Helps fix#3292
* update reinterpret docs phrasing
We agreed to use "encoding" to be friendly to user exposed messaging instead of "encoder" and "decoder" that is used internally.
* fix serializeReinterpret() test json
* changed to reflect the function's acceptance of either simple string or regex
* cast p into a Pattern
* cast p into a Pattern
* Changed test to reflect the new output from function.
* Add more keyer tests
- All forms of Unicode whitespace for both fingerprint & N-gram fingerprint
- additional N-gram fingerprint cases
* Improve fingerprint keyers
- Update N-gram fingerprint keyer to match (missed last time)
- refactor string normalization to reduce redundancy between two keyers
- add C1 controls to control characters that are stripped
- include all Unicode whitespace characters in splitting delimiter
and don't strip controls which are whitespace (HT, LF, VT, FF, CR,
NEL)
- minor cleanups, simplifications, and performance optimizations
* Clean up importer refactoring
Remove an extra copy of filename setting.
Revert some additional API changes (retaining both versions)
* Revert archive file name changes & mark as deprecated
* Add utility helpers to create array of comparable items
* Extend sort() to handle arrays with nulls
- Instead of NullPointerException on nulls, sort them last
- add JSON helpers to return Comparable[] in addition to Object[]
- Non-homogenous arrays or arrays with non-primitive
objects (array or object) are not sortable
- Add tests for both new and old sort functionality
* Refactor GREL Get tests
- move helper up to RefineTest
- move tests to the correct module
* Extend forEach() to support JSON objects - fixes#3149
Also add tests for existing forEach forms in addition to the new one
* Add a couple more tests
* Migrate reconciliation calls to OkHTTP, for #2903
* Migrate to Apache HTTP Commons
* Migrate data extension to Apache HTTP client
* Deprecate HttpURLConnection in RefineServlet
* Use LaxRedirectStrategy, clean up imports
* Remove read and pool timeouts, only keep the connection timeout
* Adapt mocking of HTTP calls after migration
* Refactor test helper
Create a version of the assert that uses the standard parameter
order and deprecate the version that uses inverted order.
* Use consistent Assert class and parameter ordering
* Fix ToDate test failure - fixes#3026
Instead of computing offset from UTC at current
point in time, use the offset from the parsed
date so that we're not affected by crossing
a daylight savings time boundary.
* Fix date parsing with locale as first format string
Also refactors for simpicity, restore some dropped tests,
and restores previous behavior of considering a bad
format string an error instead of silently ignoring it.
It does NOT address another issue which was introduced
in May 2018 of treating date/times without timzone
information as UTC instead of local.
* Restore error checking and messages
* Save & restore default timezone for tests
Also add some ToDos for places where LocalDate is being misused.
* Make sure data directory is directory, not a file
* Add a test for zip archive import
Also tests the saving of the archive file name and source filename
* Add TODOs - no functional changes
* Cosmetic cleanups
* Revert importer API changes for archive file name parameter
Fixes#2963
- restore binary compatibility to the API
- hoist the handling of both fileSource and archiveFileName from
TabularImportingParserBase and TreeImportingParserBase to
ImportingParserBase so that there's only one copy. These 3 classes are
all part of the internal implementation, so there should be no
compatibility issue.
* Revert weird flow of control for import options metadata
This reverts the very convoluted control flow that was introduced
when adding the input options to the project metadata. Instead
the metadata is all handled in the importer framework rather than
having to change APIs are have individual importers worry about
it.
The feature never had test coverage, so that is still to be added.
* Add test for import options in project metadata & fix bug
Fixes bug where same options object was being reused and overwritten,
so all copies in the list ended up the same.
* Fix text guesser so it doesn't guess wikitext
Fixes#2850
- Add simple magic detector for zip & gzip files to keep
it from attempting to guess binary files
- Add a counter for C0 controls for the same reason
- Tighten wikitable counters to require marker at
beginning of the line, per the specification
- Refactor to use Apache Commons instead of private
counting methods
- Add tests for most TextGuesser formats
* Remove misplaced duplicate test data file
* Fix LGTM warning + minor cleanups
* Use BoundedInputStream to prevent runaway lines
* Add utility functions to check/convert dates
* Add date tests and refactor to DRY up
* Fix date import - fixes#1908
Change from java.util.Date to OpenRefine 3.0+'s OffsetDateTime
Fixes#1908
* Centralize date conversion
* Moving utility methods to ParsingUtilities
* Fix tests
* Use standard text normalization - fixes#2898Fixes#2898. Fixes#409. Refs #650
Replaces homegrown ISO Latin-1 only character subsitition
with standard Java Normalize to NFD, followed by diacritic
removal and a few custom character expansions/replacements.
* Fix Mac build
* Improve compatibility with previous code
One intentional change is folding O with stroke to
oe instead of o.
- Use more powerful NFKD instead of NFD
- strip punctuation after decomposition since it can generate
new punctuation
- Add compatibility test for old asciify() method
- Add some graphically similar characters to substitution table
* Add oe character/ligature & more long S forms
* More tests for ligatures and Latin Extended
* Add Latin-1 Supplement tests
Fixes#1161
This change parallels what was done in #12571da3c00 to fix
the FingerprintKeyer and moves the diacritic removal before
the deduping. Includes a test.
* Truncate any completely empty columns on the right
Fixes#565
The current versions of Open Office create default spreadsheets
with over 1000 empty columns. Keep track of the rightmost
non-empty column when importing and truncate everything else.
Also adds a basic ODS import test.
* Fix dates in ODS spreadsheets
Fixes#2224
Refs #2863
The tree importer sorts columns/column groups by how populated
they are, which is of arguable utility, but the tie-breaker
of ordering by shortest column name is completely silly.
This change removes that and, in conjunction with a stable sort
algorithm, will preserve the original order of the columns.
* Fix two deprecated methods usages
* Test ToNumber conversions
* Test behavior of all functions when passed 0 or 8 arguments
There are 16 which fail currently on 0 args (return null or
False instead of EvalError), but have been whitelisted until
we can verify whether it's safe to change them without introducing
compatibility issues.
There are 19 which fail to return an error on too many (ie 8) args.