Skip to content

Commit

Permalink
Update BKQuery.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mesmith75 authored May 24, 2024
1 parent 46baeae commit 2a9af15
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
import os
import datetime
from GangaCore.Core.exceptions import GangaException
from GangaCore.GPIDev.Schema import Schema, Version, SimpleItem, ComponentItem
from GangaCore.GPIDev.Base import GangaObject
from GangaCore.GPIDev.Base.Proxy import isType, stripProxy, addProxy
from GangaCore.GPIDev.Base.Proxy import isType, addProxy
from GangaCore.GPIDev.Credentials import require_credential
from GangaDirac.Lib.Credentials.DiracProxy import DiracProxy
from GangaDirac.Lib.Backends.DiracUtils import get_result
from GangaDirac.Lib.Utilities.DiracUtilities import GangaDiracError
from GangaDirac.Lib.Files.DiracFile import DiracFile
Expand Down Expand Up @@ -125,12 +122,12 @@ def getDatasetMetadata(self):
msg = 'selection not supported for type="%s".' % self.type
raise GangaException(msg)
cmd = "getDataset('%s','%s','%s','%s','%s','%s', '%s')" % (self.path, self.dqflag,
self.type, self.startDate, self.endDate, self.selection, self.SMOG2)
self.type, self.startDate, self.endDate, self.selection, self.SMOG2)
from GangaCore.GPIDev.Lib.GangaList.GangaList import GangaList
knownLists = [tuple, list, GangaList]
if isType(self.dqflag, knownLists):
cmd = "getDataset('%s',%s,'%s','%s','%s','%s', '%s')" % (self.path, self.dqflag,
self.type, self.startDate, self.endDate, self.selection, self.SMOG2)
self.type, self.startDate, self.endDate, self.selection, self.SMOG2)

try:
value = get_result(cmd, 'BK query error.', credential_requirements=self.credential_requirements)
Expand Down Expand Up @@ -168,7 +165,7 @@ def getDataset(self, compressed=True, SE=None):
msg = 'selection not supported for type="%s".' % self.type
raise GangaException(msg)
cmd = "getDataset('%s','%s','%s','%s','%s','%s', %s)" % (self.path, self.dqflag,
self.type, self.startDate, self.endDate, self.selection, self.SMOG2)
self.type, self.startDate, self.endDate, self.selection, self.SMOG2)
from GangaCore.GPIDev.Lib.GangaList.GangaList import GangaList
knownLists = [tuple, list, GangaList]
if isType(self.dqflag, knownLists):
Expand Down Expand Up @@ -218,10 +215,14 @@ def getDataset(self, compressed=True, SE=None):
break
if all_archived and not self.ignore_archived:
raise GangaDiracError(
"All the files are only available on archive SEs. It is likely the data set has been archived. Contact data management to request that it be staged")
"All the files are only available on archive SEs.

Check failure on line 218 in ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py

View workflow job for this annotation

GitHub Actions / Linting

E999 SyntaxError: unterminated string literal (detected at line 218)
It is likely the data set has been archived.
Contact data management to request that it be staged")
elif all_archived:
logger.warning(
"All the files are only available on archive SEs. It is likely the data set has been archived. Contact data management to request that it be staged")
"All the files are only available on archive SEs.
It is likely the data set has been archived.
Contact data management to request that it be staged")

if compressed:
ds = LHCbCompressedDataset(files)
Expand Down Expand Up @@ -293,7 +294,7 @@ def getDatasetMetadata(self):
cmd = 'bkQueryDict(%s)' % self.dict
try:
value = get_result(cmd, 'BK query error.', credential_requirements=self.credential_requirements)
except GangaDiracError as err:
except GangaDiracError:
return {'OK': False, 'Value': {}}

files = []
Expand Down

0 comments on commit 2a9af15

Please sign in to comment.