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
Member

@jameslamb jameslamb commented Jun 12, 2018

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 jameslamb requested review from ngparas and austin3dickey Jun 12, 2018
@jameslamb jameslamb mentioned this pull request Jun 12, 2018
@jameslamb jameslamb force-pushed the jameslamb:bugfix/get_fields_aliases branch from 62dca64 to 1b8691e Jun 12, 2018
@jameslamb
Copy link
Member Author

@jameslamb jameslamb commented Jun 12, 2018

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

@jameslamb jameslamb force-pushed the jameslamb:bugfix/get_fields_aliases branch from 1b8691e to 9989e04 Jun 12, 2018
@codecov-io
Copy link

@codecov-io 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
)

This comment has been minimized.

@austin3dickey

austin3dickey Jun 18, 2018
Member

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

This comment has been minimized.

@jameslamb

jameslamb Jun 18, 2018
Author Member

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
Member

@austin3dickey austin3dickey left a comment

LGTM

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

This comment has been minimized.

@ngparas

ngparas Jun 18, 2018
Collaborator

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

This comment has been minimized.

@jameslamb

jameslamb Jun 18, 2018
Author Member

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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jameslamb jameslamb deleted the jameslamb:bugfix/get_fields_aliases branch Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.