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

hardened handling of aliases #73

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

jameslamb
Copy link
Collaborator

Sorry @austin3dickey , one more that I want to go out on the v0.3.0 release.

We don't have any tests right now on how aliases are handled in get_fields. This PR addresses that.

One thing to call out is that having multiple aliases point to the same index is a totally valid thing, and our code previously couldn't handle that. This PR adds that support as well.

One other minor bugfix...url is a base function, so I changed our internal references to es_url. I noticed it because I was getting the dreaded closure not subsettable error while debugging.

@jameslamb
Copy link
Collaborator Author

fun fact ES5.x onwards and legacy ES versions return alias results slightly differently. Added a fix to this PR. I'm glad we caught it before the release

@codecov-io
Copy link

codecov-io commented Jun 12, 2018

Codecov Report

Merging #73 into master will increase coverage by 0.84%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
+ Coverage   86.08%   86.93%   +0.84%     
==========================================
  Files           9        9              
  Lines         611      643      +32     
==========================================
+ Hits          526      559      +33     
+ Misses         85       84       -1
Impacted Files Coverage Δ
R/get_fields.R 100% <100%> (+1.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a11e8da...9989e04. Read the comment docs.

, mappingDT = mappingDT
)
, fill = TRUE
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a better way you could do this with a data.table merge but these DTs are small anyway so it probably doesn't matter

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah they're pretty small and this makes it really explicit. This is an EDA function so super-super fast performance is less important than correctness, IMHO

Copy link
Collaborator

@austin3dickey austin3dickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return(.process_alias(alias_string = resultContent))
major_version <- .get_es_version(es_host)
process_alias <- switch(
major_version
Copy link
Contributor

@ngparas ngparas Jun 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there are also minor changes in scrolling between the versions i'd love if we could pull all the version-specific stuff up higher and configure w/ passing functions instead of putting internal switches like this

doesn't have to be a blocker for now though since thats a pretty large and maybe unnecessary change for our purposes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point! I will throw that up in an issue

@jameslamb jameslamb mentioned this pull request Jun 18, 2018
@jameslamb jameslamb merged commit 8fdcd22 into uptake:master Jun 18, 2018
@jameslamb jameslamb deleted the bugfix/get_fields_aliases branch June 23, 2018 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants