-
Notifications
You must be signed in to change notification settings - Fork 1
SA-753/new release with complete socmeta #53
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3534e80
use exact SOC metadata lookup when building hierarchy nodes
dstewartons 7555094
use exact SOC metadata lookup in SOCLookup
dstewartons 395e97e
remove silent parent fallback from SocMeta get_meta_by_code
dstewartons d0ce0de
extend SOCLookup tests for exact unit-level metadata
dstewartons 512b2a9
assert example SOC lookup returns unit-level code_meta for 1111
dstewartons f10b60e
add SocMeta tests for exact metadata lookup without parent fallback
dstewartons ef155f2
update changelog
dstewartons 62871f8
bump version
dstewartons File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| """Tests for SocMeta exact-match behaviour.""" | ||
|
|
||
| from occupational_classification.meta.soc_meta import SocMeta | ||
|
|
||
|
|
||
| def test_get_meta_by_code_returns_exact_unit_metadata(): | ||
| """get_meta_by_code returns unit-level metadata for a known SOC code.""" | ||
| meta = SocMeta().get_meta_by_code("1111") | ||
| assert "error" not in meta | ||
| assert meta["code"] == "1111" | ||
| assert meta["group_title"] == "Chief executives and senior officials" | ||
|
|
||
|
|
||
| def test_get_meta_by_code_does_not_fallback_to_parent_group(): | ||
| """get_meta_by_code returns an error for unknown codes instead of parent fallback.""" | ||
| meta = SocMeta().get_meta_by_code("9999") | ||
| assert meta == {"error": "No metadata found for SOC code 9999"} | ||
|
|
||
|
|
||
| def test_get_meta_by_code_exact_matches_get_meta_by_code(): | ||
| """get_meta_by_code_exact delegates to get_meta_by_code with the same result.""" | ||
| soc_meta = SocMeta() | ||
| assert soc_meta.get_meta_by_code_exact("2112") == soc_meta.get_meta_by_code("2112") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also retrieve the description into the node metadata?
(we may choose not to do it as part of this PR, because at some point we will want to load all this meta from xls instead anyway)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
group_descriptionis already populated on hierarchy nodes from SocMeta