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

[Data Loader] [Docs] Add chain loader implementation and related docs #1096

Merged
merged 1 commit into from May 22, 2018

Conversation

robfrawley
Copy link
Collaborator

Q A
Branch? 2.0
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #1011
License MIT
Doc PR

This PR re-adds the chain loader implementation originally merged into 1.0 (as #953) but never merged into 2.0 (see #1011 (comment) and the continued conversation for more context).

Original PR Description

Chain data loader implementation. This allows one to define one "filter set" that searches multiple loader configurations (for example, this allows you to check both a Gaufrette stream loader and a file system loader simultaneously).

Here is an example configuration for the loader:

liip_imagine:

    loaders:

        foo:
            filesystem:
                # setup this loader here

        bar:
            flysystem:
                # setup this loader here

        baz:
            chain:
                # name the loaders to chain
                loaders: [foo, bar]

    filter_sets:

        my_custom_filter_set:
            data_loader: baz
            filters:
                # define your filters here

This implementation simply loops through the available loaders and selects the first valid result, so if the file exists in multiple loaders, the first defined in your configuration will be selected. For example, if file.ext exists in both the foo and bar loader, the one found via the foo loader will be returned because it is defined first for baz.chain.loaders.

Signed-off-by: Rob Frawley 2nd <rmf@src.run>
@robfrawley robfrawley added Level: New Feature 🆕 This item involves the introduction of new functionality. Type: Documentation This item pertains to documentation of this project. State: Confirmed This item has been confirmed by maintainers as legitimate. Type: Configuration This item pertains to configuration of this project. Type: Source Code This item pertains to the source code of this project. labels May 17, 2018
@robfrawley robfrawley added this to the 2.1.0 milestone May 17, 2018
@robfrawley robfrawley changed the title [Data Loader] [Docs] Add chain data loader implementation and docs [Data Loader] [Docs] Add chain loader implementation and related docs May 17, 2018
@robfrawley robfrawley added this to To Do in 2.1.0 Merges from Latest 1.x.x via automation May 17, 2018
@robfrawley robfrawley moved this from To Do to In Review in 2.1.0 Merges from Latest 1.x.x May 17, 2018
@robfrawley robfrawley mentioned this pull request May 17, 2018
@maximgubar maximgubar merged commit 0265faa into liip:2.0 May 22, 2018
2.1.0 Merges from Latest 1.x.x automation moved this from In Review to Done May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Level: New Feature 🆕 This item involves the introduction of new functionality. State: Confirmed This item has been confirmed by maintainers as legitimate. Type: Configuration This item pertains to configuration of this project. Type: Documentation This item pertains to documentation of this project. Type: Source Code This item pertains to the source code of this project.
Development

Successfully merging this pull request may close these issues.

None yet

2 participants