glue icon indicating copy to clipboard operation
glue copied to clipboard

Add join on key to UI

Open jfoster17 opened this issue 2 years ago • 4 comments

Add join_on_key to UI

Description

This is a combination of a plug-in and core changes to the link_editor to enable the creation, display, and removal of join_on_key type links (managed through a Join_Link object). This address the immediate need in #2215.

jfoster17 avatar Aug 03 '22 19:08 jfoster17

Codecov Report

Merging #2313 (44bf242) into main (f8c1e96) will increase coverage by 0.02%. The diff coverage is 90.32%.

:exclamation: Current head 44bf242 differs from pull request most recent head 1b0fb5b. Consider uploading reports for the commit 1b0fb5b to get more accurate results

@@            Coverage Diff             @@
##             main    #2313      +/-   ##
==========================================
+ Coverage   88.06%   88.08%   +0.02%     
==========================================
  Files         247      247              
  Lines       23476    23527      +51     
==========================================
+ Hits        20673    20723      +50     
- Misses       2803     2804       +1     
Impacted Files Coverage Δ
glue/dialogs/link_editor/state.py 94.44% <66.66%> (-1.23%) :arrow_down:
glue/dialogs/link_editor/qt/data_graph.py 92.32% <81.81%> (-0.23%) :arrow_down:
glue/core/link_helpers.py 85.88% <96.42%> (+1.27%) :arrow_up:
glue/core/link_manager.py 97.77% <100.00%> (+0.13%) :arrow_up:
glue/conftest.py 67.85% <0.00%> (+4.76%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 03 '22 20:08 codecov[bot]

Hey @astrofrog -- can you take a look at this solution? It's not... ideal, but it basically works. Basically I have a Join_Link(LinkCollection) object that represents the join_on_key operation and then the link_manager knows how to use this object to add or remove the appropriate _key_joins. Here are some of my concerns.

  1. Because the key joins are not the same thing at the Join_Link object, if users (or code) directly calls join_on_key, this won't create a Join_Link and so there will be no representation of the join in the UI.
  2. Because Join_Links are funny kinds of things, I end up with data_collection._link_manager_external_links holding Join_Links, but Join_Links do NOT show up in data_collection.links
  3. Currently I have this limited to "Joining on single components". (I don't see a fundamental reason I couldn't extend it to multiple components or one-to-many joins I just haven't done that yet).
  4. The display in the link manager is a little funny -- I draw these Join_Links as dashed lines, but a new Join_Link does not show up as dashed right away, only after closes and re-opening the link manager. This can probably be fixed in link_editor.qt.data_graph but I haven't dug into it a lot (it's not obvious what to display if two datasets are both joined_on_key and glued through a traditional link for some reason).
  5. I set up Join_Link as a plugin originally, hoping that I might be able to do things all as a plug-in. Now I have core components assume this plugin exists, but is obviously not ideal (a user might disable the plug-in). Presumably I should move it to core.link_helpers?

jfoster17 avatar Aug 05 '22 19:08 jfoster17

I assume you would like to be rebase and add a changelog entry when this is good-to-go?

jfoster17 avatar Aug 19 '22 16:08 jfoster17

Yes that would be great, thanks!

astrofrog avatar Aug 19 '22 16:08 astrofrog