Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

New attribute function for extracting single value for multivalued fields #766

Open
macieg opened this issue Apr 18, 2020 · 6 comments
Open

Comments

@macieg
Copy link
Contributor

macieg commented Apr 18, 2020

Currently available attribute functions don't allow to get a single value if a field has many of them.
Good example might be Poland:

      <prg-ad:jednostkaAdmnistracyjna>Polska</prg-ad:jednostkaAdmnistracyjna>
      <prg-ad:jednostkaAdmnistracyjna>kujawsko-pomorskie</prg-ad:jednostkaAdmnistracyjna>
      <prg-ad:jednostkaAdmnistracyjna>brodnicki</prg-ad:jednostkaAdmnistracyjna>
      <prg-ad:jednostkaAdmnistracyjna>Bartniczka</prg-ad:jednostkaAdmnistracyjna>

This is a part of a single address record. It contains many values for a key "prg-ad:jednostkaAdmnistracyjna". Region is always the second value here (kujawsko-pomorskie in this case).

I propose adding a new attribute function called i.e just get to extract single value.

            "conform": {
                "region": {
                    "function": "get",
                    "field": "jednostkaAdministracyjna",
                    "index": 1
                }
            }
@macieg
Copy link
Contributor Author

macieg commented Apr 18, 2020

The PR is here - #767

@macieg
Copy link
Contributor Author

macieg commented May 10, 2020

There was a wrong import #769
@iandees please approve

@macieg
Copy link
Contributor Author

macieg commented May 12, 2020

@iandees
Another one... Could you guide me how to run CI before merge?
#770

@iandees
Copy link
Member

iandees commented May 12, 2020

I think it should be running itself. @migurski am I remembering right that machine had CI tests?

@iandees
Copy link
Member

iandees commented May 13, 2020

Not sure why the CI wasn't running on your branch, but you can follow these instructions to get tests running locally: https://github.com/openaddresses/machine/blob/master/docs/install.md#local-development

@iandees
Copy link
Member

iandees commented May 13, 2020

Thanks for working through this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants