Skip to content

Implement Git Integration for SqlObserver (#735)#741

Merged
JarnoRFB merged 3 commits intoIDSIA:masterfrom
daliasen:master
Jul 14, 2020
Merged

Implement Git Integration for SqlObserver (#735)#741
JarnoRFB merged 3 commits intoIDSIA:masterfrom
daliasen:master

Conversation

@daliasen
Copy link
Contributor

@daliasen daliasen commented Jun 9, 2020

Implement #735: add tables "repository" and "experiments_repositories" for tracking Git info

repositories = set()
for r in ex_info["repositories"]:
repository = Repository.get_or_create(r["url"], r["commit"], r["dirty"], session)
session.add(repository)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do the repositories have to be added to the session, whereas the other objects are just obtained via .get_or_create ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ex_info["repositories"] can contain multiple identical items (I believe, it's one item per source and multiple sources can come from the same repository) so if .get_or_create is called for each duplicate item before the first one is added to the session, the "repository" table ends up with duplicate repositories.

My understanding is that ex_info["dependencies"] and ex_info["base_dir"] wouldn't have duplicate items in a single experiment so it's enough to check if the items were added during previous experiments.

@JarnoRFB
Copy link
Collaborator

Thanks for the contribution! I am not really an expert on sqlalchemy, but looks clean enough to me, except for the one question that I have. For the CI pipeline to succeed please run the pre-commit hooks as described in https://github.com/IDSIA/sacred/blob/master/CONTRIBUTING.rst

@JarnoRFB
Copy link
Collaborator

There seems to be some flake8 issue, but it is nothing in your code so I am merging now.

@JarnoRFB JarnoRFB merged commit aaf5b3b into IDSIA:master Jul 14, 2020
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.

2 participants