Skip to content

Commit

Permalink
Fixup 8950735: old ICAT versions do not support selecting related
Browse files Browse the repository at this point in the history
object's attributes in JPQL queries
  • Loading branch information
RKrahl committed Oct 11, 2024
1 parent 899934f commit 0787f7b
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions tests/test_06_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ class MyIngestReader(IngestReader):
"testingest_inl_1": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 2.7 K"),
Expand All @@ -133,7 +134,8 @@ class MyIngestReader(IngestReader):
"testingest_inl_2": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 5.1 K"),
Expand All @@ -160,7 +162,8 @@ class MyIngestReader(IngestReader):
"testingest_inl5_1": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 2.7 K"),
Expand Down Expand Up @@ -188,7 +191,8 @@ class MyIngestReader(IngestReader):
"testingest_inl5_2": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 5.1 K"),
Expand Down Expand Up @@ -226,7 +230,8 @@ class MyIngestReader(IngestReader):
"testingest_sep_1": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 2.7 K"),
Expand All @@ -246,7 +251,8 @@ class MyIngestReader(IngestReader):
"testingest_sep_2": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 5.1 K"),
Expand All @@ -273,7 +279,8 @@ class MyIngestReader(IngestReader):
"testingest_sep5_1": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 2.7 K"),
Expand Down Expand Up @@ -301,7 +308,8 @@ class MyIngestReader(IngestReader):
"testingest_sep5_2": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"Dy01Cp02 at 5.1 K"),
Expand Down Expand Up @@ -340,7 +348,8 @@ class MyIngestReader(IngestReader):
"testingest_sample_1": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"ab3465 at 2.7 K"),
Expand All @@ -358,7 +367,8 @@ class MyIngestReader(IngestReader):
"testingest_sample_2": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"ab3465 at 5.1 K"),
Expand All @@ -376,7 +386,8 @@ class MyIngestReader(IngestReader):
"testingest_sample_3": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"ab3466 at 2.7 K"),
Expand All @@ -394,7 +405,8 @@ class MyIngestReader(IngestReader):
"testingest_sample_4": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
False),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"raw"),
("SELECT ds.description FROM Dataset ds WHERE ds.id = %d",
"reference"),
Expand Down Expand Up @@ -723,7 +735,8 @@ def test_ingest_error_searcherr(client, investigation, schemadir, case):
"testingest_classattr_1": [
("SELECT ds.complete FROM Dataset ds WHERE ds.id = %d",
True),
("SELECT ds.type.name FROM Dataset ds WHERE ds.id = %d",
(("SELECT t.name FROM DatasetType t JOIN t.datasets AS ds "
"WHERE ds.id = %d"),
"other"),
],
},
Expand Down

0 comments on commit 0787f7b

Please sign in to comment.