lib updates
use bugzilla-dev config py3 upgrade
This commit is contained in:
Родитель
2827ac669e
Коммит
0119ad06a5
|
@ -1,18 +1,13 @@
|
|||
*.pyc
|
||||
*.log
|
||||
*.tab
|
||||
*settings.json
|
||||
out
|
||||
results/*
|
||||
tests/results/*
|
||||
Error*.txt
|
||||
bzETL/util/.svn/*
|
||||
bzETL/util/.svn
|
||||
.svn
|
||||
.idea
|
||||
*.iml
|
||||
*.egg-info
|
||||
build
|
||||
dist
|
||||
|
||||
/pyLibrary/.svn
|
||||
/results
|
||||
dist
|
|
@ -176,8 +176,8 @@ class BugHistoryParser(object):
|
|||
Log.note("PROBLEM expecting a created_ts (did you install the timezone database into your MySQL instance?)", bug_id=self.currBugID)
|
||||
|
||||
for b in self.currBugState.blocked:
|
||||
if isinstance(b, basestring):
|
||||
Log.note("PROBLEM error", bug_id=self.currBugID)
|
||||
if isinstance(b, text_type):
|
||||
Log.note("PROBLEM error {{bug_id}}", bug_id=self.currBugID)
|
||||
self.prev_row = row_in
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
"bugzilla":{
|
||||
"preamble":"from https://github.com/klahnakoski/Bugzilla-ETL",
|
||||
"host":"localhost",
|
||||
"port":3306,
|
||||
"$ref":"//~/private.json#bugzilla",
|
||||
"port":3307,
|
||||
"$ref":"//~/private.json#bugzilla-dev",
|
||||
"schema":"test_bugzilla",
|
||||
"debug":false
|
||||
},
|
||||
|
|
|
@ -13,11 +13,10 @@
|
|||
"allow_private_bugs": false
|
||||
},
|
||||
"bugzilla": {
|
||||
"$ref":"//~/private.json#bugzilla-dev",
|
||||
"host": "localhost",
|
||||
"preamble": "from https://github.com/klahnakoski/Bugzilla-ETL",
|
||||
"port": 3306,
|
||||
"username": "username",
|
||||
"password": "password",
|
||||
"port": 3307,
|
||||
"schema": "bugzilla",
|
||||
"debug": false
|
||||
},
|
||||
|
|
|
@ -71,8 +71,8 @@
|
|||
"filename": "./tests/resources/sql/small_bugzilla.sql",
|
||||
"preamble": "from https://github.com/klahnakoski/Bugzilla-ETL",
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
"$ref":"file://~/private.json#bugzilla",
|
||||
"port": 3307,
|
||||
"$ref":"file://~/private.json#bugzilla-dev",
|
||||
"schema": "test_bugzilla",
|
||||
"expires_on": 1372867005000,
|
||||
"debug": true,
|
||||
|
|
|
@ -126,19 +126,19 @@
|
|||
"filename": "./tests/resources/sql/small_bugzilla.sql",
|
||||
"preamble": "from https://github.com/klahnakoski/Bugzilla-ETL",
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
"port": 3307,
|
||||
"schema": "test_bugzilla",
|
||||
"expires_on": 1372867005000,
|
||||
"debug": false,
|
||||
"$ref": "//~/private.json#bugzilla"
|
||||
"$ref": "//~/private.json#bugzilla-dev"
|
||||
},
|
||||
"bugzilla2": {
|
||||
"host": "klahnakoski-es.corp.tor1.mozilla.com",
|
||||
"port": 3306,
|
||||
"port": 3307,
|
||||
"schema": "bugzilla2",
|
||||
"expires_on": 1372867005000,
|
||||
"debug": true,
|
||||
"$ref": "//~/private.json#bugzilla"
|
||||
"$ref": "//~/private.json#bugzilla-dev"
|
||||
},
|
||||
"constants": {
|
||||
"pyLibrary.env.http.default_headers": {
|
||||
|
|
|
@ -496,7 +496,7 @@ def isKeyword(value):
|
|||
"""
|
||||
RETURN TRUE IF THE value IS JUST A NAME OF A FIELD, A LIST OF FIELDS, (OR A VALUE)
|
||||
"""
|
||||
if not value or not isinstance(value, basestring):
|
||||
if not value or not isinstance(value, text_type):
|
||||
Log.error("Expecting a string")
|
||||
|
||||
if keyword_pattern.match(value):
|
||||
|
|
|
@ -231,7 +231,7 @@ class Cube(Container):
|
|||
data={k: Matrix(values=c.__getitem__(coordinates)) for k, c in self.data.items()}
|
||||
)
|
||||
return output
|
||||
elif isinstance(item, basestring):
|
||||
elif isinstance(item, text_type):
|
||||
# RETURN A VALUE CUBE
|
||||
if self.is_value:
|
||||
if item != self.select.name:
|
||||
|
|
|
@ -55,7 +55,7 @@ class PartFlatList(list):
|
|||
if isinstance(fields, Mapping):
|
||||
fields=fields.value
|
||||
|
||||
if isinstance(fields, basestring):
|
||||
if isinstance(fields, text_type):
|
||||
# RETURN LIST OF VALUES
|
||||
if len(split_field(fields)) == 1:
|
||||
if self.path[0] == fields:
|
||||
|
|
|
@ -94,7 +94,7 @@ class Normal(Namespace):
|
|||
return output
|
||||
|
||||
def _convert_from(self, frum):
|
||||
if isinstance(frum, basestring):
|
||||
if isinstance(frum, text_type):
|
||||
return Data(name=frum)
|
||||
elif isinstance(frum, (Container, QueryOp)):
|
||||
return frum
|
||||
|
@ -102,7 +102,7 @@ class Normal(Namespace):
|
|||
Log.error("Expecting from clause to be a name, or a container")
|
||||
|
||||
def _convert_select(self, select):
|
||||
if isinstance(select, basestring):
|
||||
if isinstance(select, text_type):
|
||||
return Data(
|
||||
name=select.rstrip("."), # TRAILING DOT INDICATES THE VALUE, BUT IS INVALID FOR THE NAME
|
||||
value=select,
|
||||
|
@ -111,7 +111,7 @@ class Normal(Namespace):
|
|||
else:
|
||||
select = wrap(select)
|
||||
output = copy(select)
|
||||
if not select.value or isinstance(select.value, basestring):
|
||||
if not select.value or isinstance(select.value, text_type):
|
||||
if select.value == ".":
|
||||
output.name = coalesce(select.name, select.aggregate)
|
||||
else:
|
||||
|
@ -126,7 +126,7 @@ class Normal(Namespace):
|
|||
return output
|
||||
|
||||
def _convert_edge(self, edge):
|
||||
if isinstance(edge, basestring):
|
||||
if isinstance(edge, text_type):
|
||||
return Data(
|
||||
name=edge,
|
||||
value=edge,
|
||||
|
@ -134,7 +134,7 @@ class Normal(Namespace):
|
|||
)
|
||||
else:
|
||||
edge = wrap(edge)
|
||||
if not edge.name and not isinstance(edge.value, basestring):
|
||||
if not edge.name and not isinstance(edge.value, text_type):
|
||||
Log.error("You must name compound edges: {{edge}}", edge= edge)
|
||||
|
||||
if isinstance(edge.value, (Mapping, list)) and not edge.domain:
|
||||
|
@ -158,7 +158,7 @@ class Normal(Namespace):
|
|||
)
|
||||
|
||||
def _convert_group(self, column):
|
||||
if isinstance(column, basestring):
|
||||
if isinstance(column, text_type):
|
||||
return wrap({
|
||||
"name": column,
|
||||
"value": column,
|
||||
|
@ -169,7 +169,7 @@ class Normal(Namespace):
|
|||
if (column.domain and column.domain.type != "default") or column.allowNulls != None:
|
||||
Log.error("groupby does not accept complicated domains")
|
||||
|
||||
if not column.name and not isinstance(column.value, basestring):
|
||||
if not column.name and not isinstance(column.value, text_type):
|
||||
Log.error("You must name compound edges: {{edge}}", edge= column)
|
||||
|
||||
return wrap({
|
||||
|
@ -237,7 +237,7 @@ def normalize_sort(sort=None):
|
|||
|
||||
output = FlatList()
|
||||
for s in listwrap(sort):
|
||||
if isinstance(s, basestring) or Math.is_integer(s):
|
||||
if isinstance(s, text_type) or Math.is_integer(s):
|
||||
output.append({"value": s, "sort": 1})
|
||||
elif not s.field and not s.value and s.sort==None:
|
||||
#ASSUME {name: sort} FORM
|
||||
|
|
|
@ -50,7 +50,7 @@ class Rename(Namespace):
|
|||
return "."
|
||||
elif is_variable_name(expr):
|
||||
return coalesce(self.dimensions[expr], expr)
|
||||
elif isinstance(expr, basestring):
|
||||
elif isinstance(expr, text_type):
|
||||
Log.error("{{name|quote}} is not a valid variable name", name=expr)
|
||||
elif isinstance(expr, Date):
|
||||
return expr
|
||||
|
|
|
@ -163,7 +163,7 @@ def value2url_param(value):
|
|||
if isinstance(value, Mapping):
|
||||
value_ = wrap(value)
|
||||
output = b"&".join([
|
||||
value2url_param(k) + b"=" + (value2url_param(v) if isinstance(v, basestring) else value2url_param(value2json(v)))
|
||||
value2url_param(k) + b"=" + (value2url_param(v) if isinstance(v, text_type) else value2url_param(value2json(v)))
|
||||
for k, v in value_.leaves()
|
||||
])
|
||||
elif isinstance(value, text_type):
|
||||
|
|
|
@ -33,7 +33,7 @@ class StructuredLogger_usingThreadedStream(StructuredLogger):
|
|||
|
||||
use_UTF8 = False
|
||||
|
||||
if isinstance(stream, basestring):
|
||||
if isinstance(stream, text_type):
|
||||
if stream.startswith("sys."):
|
||||
use_UTF8 = True # sys.* ARE OLD AND CAN NOT HANDLE unicode
|
||||
self.stream = eval(stream)
|
||||
|
|
|
@ -79,7 +79,7 @@ class MySQL(object):
|
|||
|
||||
|
||||
def _subquery(self, query, isolate=True, stacked=False):
|
||||
if isinstance(query, basestring):
|
||||
if isinstance(query, text_type):
|
||||
return self.db.quote_column(query), None
|
||||
if query.name: # IT WOULD BE SAFER TO WRAP TABLE REFERENCES IN A TYPED OBJECT (Cube, MAYBE?)
|
||||
return self.db.quote_column(query.name), None
|
||||
|
@ -413,12 +413,12 @@ def _esfilter2sqlwhere(db, esfilter):
|
|||
output = _isolate("AND", [single(col, ranges) for col, ranges in esfilter.range.items()])
|
||||
return output
|
||||
elif esfilter.missing:
|
||||
if isinstance(esfilter.missing, basestring):
|
||||
if isinstance(esfilter.missing, text_type):
|
||||
return "(" + db.quote_column(esfilter.missing) + " IS Null)"
|
||||
else:
|
||||
return "(" + db.quote_column(esfilter.missing.field) + " IS Null)"
|
||||
elif esfilter.exists:
|
||||
if isinstance(esfilter.exists, basestring):
|
||||
if isinstance(esfilter.exists, text_type):
|
||||
return "(" + db.quote_column(esfilter.exists) + " IS NOT Null)"
|
||||
else:
|
||||
return "(" + db.quote_column(esfilter.exists.field) + " IS NOT Null)"
|
||||
|
@ -434,7 +434,7 @@ def expand_json(rows):
|
|||
# CONVERT JSON TO VALUES
|
||||
for r in rows:
|
||||
for k, json in list(r.items()):
|
||||
if isinstance(json, basestring) and json[0:1] in ("[", "{"):
|
||||
if isinstance(json, text_type) and json[0:1] in ("[", "{"):
|
||||
with suppress_exception:
|
||||
value = mo_json.json2value(json)
|
||||
r[k] = value
|
||||
|
|
|
@ -591,7 +591,7 @@ class MySQL(object):
|
|||
return value
|
||||
param = {k: self.quote_sql(v) for k, v in param.items()}
|
||||
return expand_template(value, param)
|
||||
elif isinstance(value, basestring):
|
||||
elif isinstance(value, text_type):
|
||||
return value
|
||||
elif isinstance(value, Mapping):
|
||||
return self.db.literal(json_encode(value))
|
||||
|
|
|
@ -135,7 +135,7 @@ class Redshift(object):
|
|||
return output
|
||||
|
||||
def quote_column(self, name):
|
||||
if isinstance(name, basestring):
|
||||
if isinstance(name, text_type):
|
||||
return SQL('"' + name.replace('"', '""') + '"')
|
||||
return SQL("(" + (", ".join(self.quote_value(v) for v in name)) + ")")
|
||||
|
||||
|
@ -146,7 +146,7 @@ class Redshift(object):
|
|||
json = value2json(value)
|
||||
return self.quote_value(json)
|
||||
|
||||
if isinstance(value, basestring) and len(value) > 256:
|
||||
if isinstance(value, text_type) and len(value) > 256:
|
||||
value = value[:256]
|
||||
return SQL(adapt(value))
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ def quote_value(value):
|
|||
return text_type(value.unix)
|
||||
elif isinstance(value, Duration):
|
||||
return text_type(value.seconds)
|
||||
elif isinstance(value, basestring):
|
||||
elif isinstance(value, text_type):
|
||||
return "'" + value.replace("'", "''") + "'"
|
||||
elif value == None:
|
||||
return "NULL"
|
||||
|
|
Загрузка…
Ссылка в новой задаче