Skip to content

Commit

Permalink
fix bug in user input where use_case arg not accounted for (#128)
Browse files Browse the repository at this point in the history
* fix bug in user input where use_case arg not accounted for

* Update CHANGELOG.md
  • Loading branch information
a-s-g93 authored Oct 15, 2024
1 parent 6cbcfd0 commit fc5e9f8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Fixed

* Fix bug where `use_cases` arg in `UserInput` not accounted for.

### Changed

### Added
Expand Down
8 changes: 6 additions & 2 deletions neo4j_runway/discovery/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ def __init__(
)
elif not isinstance(user_input, UserInput) and isinstance(data, Table):
self.user_input = user_input_safe_construct(
unsafe_user_input=user_input, data_dictionary=data.data_dictionary
unsafe_user_input=user_input,
data_dictionary=data.data_dictionary,
use_cases=data.use_cases,
)
elif not isinstance(user_input, UserInput) and isinstance(
data, TableCollection
):
self.user_input = user_input_safe_construct(
unsafe_user_input=user_input, data_dictionary=data.data_dictionary
unsafe_user_input=user_input,
data_dictionary=data.data_dictionary,
use_cases=data.use_cases,
)
elif isinstance(user_input, UserInput):
self.user_input = user_input
Expand Down
2 changes: 1 addition & 1 deletion neo4j_runway/inputs/user_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@ def _is_multifile() -> bool:
data_dictionary=data_dictionary
or unsafe_user_input
or {k: "" for k in allowed_columns},
use_cases=use_cases,
use_cases=use_cases or unsafe_user_input.get("use_cases"),
)
2 changes: 1 addition & 1 deletion neo4j_runway/modeler/modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def __init__(
self.user_input = discovery.user_input
# data dictionary should have been constructed before / during the discovery phase
self._data_dictionary = discovery.data.data_dictionary

self.discovery = discovery.discovery
self.user_input = discovery.user_input

else:
if not allowed_columns and not user_input and not data_dictionary:
Expand Down

0 comments on commit fc5e9f8

Please sign in to comment.