Code Monkey home page Code Monkey logo

Comments (6)

ralfstrobel avatar ralfstrobel commented on May 30, 2024

While debugging this further, I've also noticed that the Implementation of Reader::next() returns the current value, while the Iterator interface defines the return as void. This doesn't waste much performance, but is still unnecessary, especially given the additional call to adjustRowOutput(). During iteration the value will always be obtained via a separate call to current().

from xlsx-reader.

adirfische avatar adirfische commented on May 30, 2024

Hey there,

The just-released version v0.10.0 should address these issues now. Please check it out.

To make the reader behave in the way you described, configure it similarly to this:

$reader = new Reader(
    (new ReaderConfiguration())
        ->setSkipEmptyRows(ReaderSkipConfiguration::SKIP_TRAILING_EMPTY)
);

If you wish to skip all empty rows instead of only trailing ones, replace SKIP_TRAILING_EMPTY with SKIP_EMPTY.

Sidenote, if you happen to make use of SkipEmptyCells:
Be advised that SkipEmptyCells now also requires ReaderSkipConfiguration values, making its interface similar to that of SkipEmptyRows. You may need to adapt your usages accordingly.

from xlsx-reader.

ralfstrobel avatar ralfstrobel commented on May 30, 2024

Thank you for your work!

Sadly, I was unable to test the new feature, or even get the new library version to run due to two breaking changes you introduced...

  1. ReaderConfiguration::setSkipEmptyCells() used to enforce a boolean argument, now enforces an integer constant, which results in an InvalidArgumentException with our old code. Not a major problem, but still undesirable for a minor version release.
  2. More importantly for us, ITST-21347 has changed the semantics of ReaderConfiguration::setReturnUnformatted(). In version 0.9, it did not affect date values, i.e. it could be used in conjunction with ReaderConfiguration::setReturnDateTimeObjects(false) and the format setters to receive ISO8601 strings for date values, which is what we did. In version 0.10, the unformatted directive now takes precedence and thus an internal Excel date floating point representation is returned. We can open a separate issue to discuss this further if desired.

from xlsx-reader.

adirfische avatar adirfische commented on May 30, 2024

1.: Yes, that's what I wanted to point out with the sidenote I added to the end of my previous comment. That integer should be a ReaderSkipConfiguration constant now. It behaves the same way the new option setSkipEmptyRows() does.

Regarding your versioning concerns, be advised that this library is currently using a version <v1. This implies slightly different semantics for the versioning pattern. In particular, it implies that all version updates should be considered unsafe.
To at least provide a bit of safety though, this library adheres to the behavior e.g. composer exposes when dealing with such versions, which is that the 2nd digit of the version is considered the "major" one. As such, in the context of this library, for breaking changes, said digit of the version number will be bumped, and for minor releases, the following ones.
(e.g.: v0.8.0 -> v0.9.0: major release, v0.8.0 -> v0.8.1: minor release)
The respective note can be found here: https://getcomposer.org/doc/articles/versions.md#caret-version-range-

Of course, should we decide to bump the version to v1.x.x at some point, the semantic versioning rules you already expected will begin to apply.

2.: Yes, that's a bug. : ) Thank you for testing and reporting, a fix is in the works.

from xlsx-reader.

adirfische avatar adirfische commented on May 30, 2024

The just-released v0.10.1 contains a fix for the aforementioned issue regarding the usage of returnUnformatted with date/time configuration options.

from xlsx-reader.

ralfstrobel avatar ralfstrobel commented on May 30, 2024

Yeah, seems to work fine now, at least as far as our own automated tests are concerned. Thanks again!

from xlsx-reader.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.