FREVA-CLINT / freva

The Free Evaluation System Framework (FreVa)
Other
10 stars 3 forks source link

Quick fix solr update. #139

Closed antarcticrainforest closed 1 year ago

antarcticrainforest commented 1 year ago

This should fix the timeout error witnessed when counting facet values. I don't know what triggered this.

I've also noticed that we do have a lot of unit tests that the databrowser to return query results in a particular way. For my taste too specific. Since we are changing the solr config more often these very specific tests tend to break, which can get annoying.

I've just added sporadic tests, for example, checking the variable facet in the result rather than testing whether the result is exactly the anticipated output. I know that this is not as thorough but I think that's the best we can do at the moment.

eelucio commented 1 year ago

this is unrelated to your updates but why are you linting going thru and mine not when all the linting problems belong to old code?

all the errors are related to these 3 files:

antarcticrainforest commented 1 year ago

You did changes the files that cause black to fail:

user = models.ForeignKey(
        User, on_delete=models.CASCADE
    )  # Modified 10-05-2021 Mahesh

and now:

  user = models.ForeignKey(
        User, on_delete=models.CASCADE
    ) 

which I guess should be:

user = models.ForeignKey(User, on_delete=models.CASCADE)

With the other files the linter is not complaining, as you didn't change them.

eelucio commented 1 year ago

I only removed the comment (# Modified 10-05-2021 Mahesh) did not even format that:

    user = models.ForeignKey(
        User, on_delete=models.CASCADE
    )

Although in my local repo it appears as:

   user = models.ForeignKey(User, on_delete=models.CASCADE)

anyway, it fails whether I put it in 3 lines or in 1 and I am having errors for all 3 files:

$ make lint
mypy --install-types --non-interactive
src/evaluation_system/model/solr_models/models.py:36: error: Need type annotation for "created"  [var-annotated]
src/evaluation_system/model/solr_models/models.py:37: error: Need type annotation for "status"  [var-annotated]
src/evaluation_system/model/solr_models/models.py:39: error: Need type annotation for "user"  [var-annotated]
src/evaluation_system/model/solr_models/models.py:42: error: Need type annotation for "path_to_crawl"  [var-annotated]
src/evaluation_system/model/solr_models/models.py:43: error: Need type annotation for "tar_file"  [var-annotated]
src/evaluation_system/model/solr_models/models.py:44: error: Need type annotation for "ingest_msg"  [var-annotated]
src/evaluation_system/model/plugins/models.py:11: error: Need type annotation for "timestamp"  [var-annotated]
src/evaluation_system/model/plugins/models.py:13: error: Need type annotation for "tool"  [var-annotated]
src/evaluation_system/model/plugins/models.py:15: error: Need type annotation for "version"  [var-annotated]
src/evaluation_system/model/plugins/models.py:17: error: Need type annotation for "internal_version_tool"  [var-annotated]
src/evaluation_system/model/plugins/models.py:19: error: Need type annotation for "internal_version_api"  [var-annotated]
src/evaluation_system/model/plugins/models.py:21: error: Need type annotation for "repository"  [var-annotated]
src/evaluation_system/model/plugins/models.py:44: error: Need type annotation for "parameter_name"  [var-annotated]
src/evaluation_system/model/plugins/models.py:46: error: Need type annotation for "parameter_type"  [var-annotated]
src/evaluation_system/model/plugins/models.py:48: error: Need type annotation for "tool"  [var-annotated]
src/evaluation_system/model/plugins/models.py:50: error: Need type annotation for "version"  [var-annotated]
src/evaluation_system/model/plugins/models.py:52: error: Need type annotation for "mandatory"  [var-annotated]
src/evaluation_system/model/plugins/models.py:54: error: Need type annotation for "default"  [var-annotated]
src/evaluation_system/model/plugins/models.py:62: error: Need type annotation for "impact"  [var-annotated]
src/evaluation_system/model/history/models.py:76: error: Need type annotation for "timestamp"  [var-annotated]
src/evaluation_system/model/history/models.py:78: error: Need type annotation for "tool"  [var-annotated]
src/evaluation_system/model/history/models.py:80: error: Need type annotation for "version"  [var-annotated]
src/evaluation_system/model/history/models.py:82: error: Need type annotation for "version_details"  [var-annotated]
src/evaluation_system/model/history/models.py:84: error: Need type annotation for "configuration"  [var-annotated]
src/evaluation_system/model/history/models.py:86: error: Need type annotation for "slurm_output"  [var-annotated]
src/evaluation_system/model/history/models.py:88: error: Need type annotation for "host"  [var-annotated]
src/evaluation_system/model/history/models.py:90: error: Need type annotation for "uid"  [var-annotated]
src/evaluation_system/model/history/models.py:94: error: Need type annotation for "status"  [var-annotated]
src/evaluation_system/model/history/models.py:96: error: Need type annotation for "flag"  [var-annotated]
src/evaluation_system/model/history/models.py:98: error: Need type annotation for "caption"  [var-annotated]
src/evaluation_system/model/history/models.py:318: error: Need type annotation for "history_id"  [var-annotated]
src/evaluation_system/model/history/models.py:320: error: Need type annotation for "output_file"  [var-annotated]
src/evaluation_system/model/history/models.py:322: error: Need type annotation for "preview_file"  [var-annotated]
src/evaluation_system/model/history/models.py:324: error: Need type annotation for "file_type"  [var-annotated]
src/evaluation_system/model/history/models.py:364: error: Need type annotation for "result_id"  [var-annotated]
src/evaluation_system/model/history/models.py:366: error: Need type annotation for "type"  [var-annotated]
src/evaluation_system/model/history/models.py:368: error: Need type annotation for "text"  [var-annotated]
src/evaluation_system/model/history/models.py:395: error: Need type annotation for "history_id"  [var-annotated]
src/evaluation_system/model/history/models.py:397: error: Need type annotation for "type"  [var-annotated]
src/evaluation_system/model/history/models.py:399: error: Need type annotation for "text"  [var-annotated]
src/evaluation_system/model/history/models.py:401: error: Need type annotation for "uid"  [var-annotated]
src/evaluation_system/model/history/models.py:417: error: Need type annotation for "history_id"  [var-annotated]
src/evaluation_system/model/history/models.py:422: error: Need type annotation for "parameter_id"  [var-annotated]
src/evaluation_system/model/history/models.py:427: error: Need type annotation for "md5"  [var-annotated]
src/evaluation_system/model/history/models.py:430: error: Need type annotation for "value"  [var-annotated]
src/evaluation_system/model/history/models.py:433: error: Need type annotation for "is_default"  [var-annotated]
eelucio commented 1 year ago

I cloned the repo somewhere else, I changed to this branch (solr-fix), I copied the files from there to my branch and I run the make lint, it still fails, so it cannot be my changes.

Karinon commented 1 year ago

@eelucio did you rebuild your conda-env? I assume that you are using an old version of mypy or something like this. I had similar issues with black in another project.

For me make lint is successful.

$ mypy --version
mypy 1.4.1 (compiled: yes)
eelucio commented 1 year ago

I updated the environment but I did not re-install it from scratch, but I will do it.

In any case the issue is that when I push my changes lint complains of a formatting that I did not change and apparently is not complaining in this (solr-fix) branch. It could fail in one line, but not in the rest of the files that I did not touch.

Karinon commented 1 year ago

@eelucio It seems that my "approval" does not count as I have no "write access" to the regular freva repo? Needs your approval as well I guess.

antarcticrainforest commented 1 year ago

I can merge anyway

eelucio commented 1 year ago

wtf?

soprry, I was late