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

Update connection parameters #239

Merged
merged 5 commits into from
Jun 19, 2019
Merged

Update connection parameters #239

merged 5 commits into from
Jun 19, 2019

Conversation

wamsiv
Copy link
Contributor

@wamsiv wamsiv commented Jun 10, 2019

As per the new changes in core, update default user name and database name to admin and omnisci respectively
Similar updates to documentation
Update connection parameters unit tests

cc: @mattdlh

I have not changed the connection URL to start with omnisci:

>>> pymapd.connect(user="admin", password="HyperInteractive",host="localhost",dbname="omnisci") 
Connection(mapd://admin:***@localhost:6274/omnisci?protocol=binary) 

It still starts with mapd left it to be in sync with repository name pymapd. Please let me know if that should be changed as well.

As per the new changes in core, update default user name and database name to admin and omnisci respectively
Similar updates to documentation
Update connection parameters unit tests
Copy link
Contributor

@randyzwitch randyzwitch left a comment

Choose a reason for hiding this comment

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

Since you are already making the changes, it feels like you should change the leading mapd in the connection to omnisci, assuming that also works

tests/test_integration.py Outdated Show resolved Hide resolved
@wamsiv
Copy link
Contributor Author

wamsiv commented Jun 14, 2019

After discussion with @andrewseidl and looking at the changes, It seems like a good idea to make the remaining mapd in next PR, as it is more than the scope of this PR and might need extra handling to check any lapses in code.

@@ -337,35 +337,53 @@ def test_dashboard_duplication_remap(self, con):
"title": new_dashboard_name
}
}
dashboard_id = ""
dashboards = []
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of this empty dashboards list? Does this get overwritten later if you fall into the exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it just a function scope placeholder I initialized to be used in different places throughout.

for dashboard in dashboards:
if dashboard.dashboard_name == old_dashboard_name:
dashboard_id = dashboard.dashboard_id
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like the try/catch is overkill here. Ultimately this problem is one of cleaning up after the tests. Other tests just check for the presence of the thing being created and drop it (like a table existing already), then re-create it. Here, we're nesting the logic into try/catch and duplicating the code, when it would be much simpler to just make the test either clean up after itself or drop the dashboard before trying to create it again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is more efficient in present circumstances than always looping over all dashboards each time. Here we only use getdasboards call when we have to for each case. Regarding duplication, I can move them to separate function.

@wamsiv
Copy link
Contributor Author

wamsiv commented Jun 18, 2019

@mattdh Please refer to here for latest changes.

@mattdlh
Copy link
Contributor

mattdlh commented Jun 19, 2019

@wamsiv I just pushed a commit with a few final changes containing updated db name. Looks like the changes are working against the latest version. Tests being ran both pip and conda.

@wamsiv
Copy link
Contributor Author

wamsiv commented Jun 19, 2019

Danke @mattdlh! The PR can be merged once Travis test passes. I have verified them locally.

@wamsiv wamsiv requested a review from randyzwitch June 19, 2019 02:07
@wamsiv wamsiv merged commit 0028b9d into master Jun 19, 2019
@wamsiv wamsiv deleted the wam/update_unit_tests branch June 19, 2019 17:22
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

3 participants