after_merge stringlengths 28 79.6k | before_merge stringlengths 20 79.6k | url stringlengths 38 71 | full_traceback stringlengths 43 922k | traceback_type stringclasses 555
values |
|---|---|---|---|---|
def process(
self, *, in_str: str, fname: Optional[str] = None, config=None
) -> Tuple[Optional[TemplatedFile], list]:
"""Process a string and return the new string.
Note that the arguments are enforced as keywords
because Templaters can have differences in their
`process` method signature.
A T... | def process(
self, *, in_str: str, fname: Optional[str] = None, config=None
) -> Tuple[Optional[TemplatedFile], list]:
"""Process a string and return the new string.
Note that the arguments are enforced as keywords
because Templaters can have differences in their
`process` method signature.
A T... | https://github.com/sqlfluff/sqlfluff/issues/600 | Traceback (most recent call last):
File "/Users/niallwoodward/dev/pull_requests/dbt_sqlfluff_venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff', 'console_scripts', 'sqlfluff')()
File "/Users/niallwoodward/dev/pull_requests/dbt_sqlfluff_venv/lib/python3.6/site-packages/click/core.py", line 829, in __ca... | IndexError |
def process(
self, *, in_str: str, fname: Optional[str] = None, config=None
) -> Tuple[Optional[TemplatedFile], list]:
"""Process a string and return a TemplatedFile.
Note that the arguments are enforced as keywords
because Templaters can have differences in their
`process` method signature.
A ... | def process(
self, *, in_str: str, fname: Optional[str] = None, config=None
) -> Tuple[Optional[TemplatedFile], list]:
"""Process a string and return a TemplatedFile.
Note that the arguments are enforced as keywords
because Templaters can have differences in their
`process` method signature.
A ... | https://github.com/sqlfluff/sqlfluff/issues/600 | Traceback (most recent call last):
File "/Users/niallwoodward/dev/pull_requests/dbt_sqlfluff_venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff', 'console_scripts', 'sqlfluff')()
File "/Users/niallwoodward/dev/pull_requests/dbt_sqlfluff_venv/lib/python3.6/site-packages/click/core.py", line 829, in __ca... | IndexError |
def slice_file(
cls, raw_str: str, templated_str: str, config=None
) -> Tuple[List[RawFileSlice], List[TemplatedFileSlice], str]:
"""Slice the file to determine regions where we can fix."""
templater_logger.info("Slicing File Template")
templater_logger.debug(" Raw String: %r", raw_str)
templater... | def slice_file(
cls, raw_str: str, templated_str: str
) -> Tuple[List[RawFileSlice], List[TemplatedFileSlice]]:
"""Slice the file to determine regions where we can fix."""
templater_logger.info("Slicing File Template")
templater_logger.debug(" Raw String: %r", raw_str)
templater_logger.debug(" ... | https://github.com/sqlfluff/sqlfluff/issues/600 | Traceback (most recent call last):
File "/Users/niallwoodward/dev/pull_requests/dbt_sqlfluff_venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff', 'console_scripts', 'sqlfluff')()
File "/Users/niallwoodward/dev/pull_requests/dbt_sqlfluff_venv/lib/python3.6/site-packages/click/core.py", line 829, in __ca... | IndexError |
def _lint_references_and_aliases(self, aliases, references, using_cols, parent_select):
"""Check whether any aliases are duplicates.
NB: Subclasses of this error should override this function.
"""
# Are any of the aliases the same?
for a1, a2 in itertools.combinations(aliases, 2):
# Compar... | def _lint_references_and_aliases(self, aliases, references, using_cols, parent_select):
"""Check whether any aliases are duplicates.
NB: Subclasses of this error should override this function.
"""
# Are any of the aliases the same?
for a1, a2 in itertools.combinations(aliases, 2):
# Compar... | https://github.com/sqlfluff/sqlfluff/issues/377 | Traceback (most recent call last):
File "/Users/florentpezet/.pyenv/versions/sqlfluff-3.7.5/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff', 'console_scripts', 'sqlfluff')()
File "/Users/florentpezet/.pyenv/versions/sqlfluff-3.7.5/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return ... | AttributeError |
def stats(self):
"""Return a stats dictionary of this result."""
all_stats = dict(files=0, clean=0, unclean=0, violations=0)
for path in self.paths:
all_stats = self.sum_dicts(path.stats(), all_stats)
if all_stats["files"] > 0:
all_stats["avg per file"] = all_stats["violations"] * 1.0 / ... | def stats(self):
"""Return a stats dictionary of this result."""
all_stats = dict(files=0, clean=0, unclean=0, violations=0)
for path in self.paths:
all_stats = self.sum_dicts(path.stats(), all_stats)
all_stats["avg per file"] = all_stats["violations"] * 1.0 / all_stats["files"]
all_stats["u... | https://github.com/sqlfluff/sqlfluff/issues/224 | Traceback (most recent call last):
File "/usr/local/pyenv/versions/lib-3.7.3/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.3.1', 'console_scripts', 'sqlfluff')()
File "/usr/local/pyenv/versions/3.7.3/envs/lib-3.7.3/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.mai... | ZeroDivisionError |
def fix(force, paths, **kwargs):
"""Fix SQL files.
PATH is the path to a sql file or directory to lint. This can be either a
file ('path/to/file.sql'), a path ('directory/of/sql/files'), a single ('-')
character to indicate reading from *stdin* or a dot/blank ('.'/' ') which will
be interpreted lik... | def fix(force, paths, **kwargs):
"""Fix SQL files.
PATH is the path to a sql file or directory to lint. This can be either a
file ('path/to/file.sql'), a path ('directory/of/sql/files'), a single ('-')
character to indicate reading from *stdin* or a dot/blank ('.'/' ') which will
be interpreted lik... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def num_violations(self, rules=None, types=None):
"""Count the number of violations.
Optionally now with filters.
"""
violations = self.violations
if types:
try:
types = tuple(types)
except TypeError:
types = (types,)
violations = [v for v in violatio... | def num_violations(self):
"""Count the number of violations."""
return len(self.violations)
| https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def fix_string(self, verbosity=0):
"""Obtain the changes to a path as a string.
We use the file_mask to do a safe merge, avoiding any templated
sections. First we need to detect where there have been changes
between the fixed and templated versions. The file mask is of
the format: (raw_file, templa... | def fix_string(self, verbosity=0):
"""Obtain the changes to a path as a string.
We use the file_mask to do a safe merge, avoiding any templated
sections. First we need to detect where there have been changes
between the fixed and templated versions.
We use difflib.SequenceMatcher.get_opcodes
S... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def persist_tree(self, verbosity=0):
"""Persist changes to the given path.
We use the file_mask to do a safe merge, avoiding any templated
sections. First we need to detect where there have been changes
between the fixed and templated versions.
We use difflib.SequenceMatcher.get_opcodes
See: h... | def persist_tree(self, verbosity=0):
"""Persist changes to the given path.
We use the file_mask to do a safe merge, avoiding any templated
sections. First we need to detect where there have been changes
between the fixed and templated versions.
We use difflib.SequenceMatcher.get_opcodes
See: h... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def num_violations(self, **kwargs):
"""Count the number of violations in the path."""
return sum(file.num_violations(**kwargs) for file in self.files)
| def num_violations(self):
"""Count the number of violations in the path."""
return sum(file.num_violations() for file in self.files)
| https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def persist_changes(self, verbosity=0, output_func=None, **kwargs):
"""Persist changes to files in the given path.
This also logs the output using the output_func if present.
"""
# Run all the fixes for all the files and return a dict
buffer = {}
for file in self.files:
if self.num_viol... | def persist_changes(self, verbosity=0):
"""Persist changes to files in the given path."""
# Run all the fixes for all the files and return a dict
return {file.path: file.persist_tree(verbosity=verbosity) for file in self.files}
| https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def num_violations(self, **kwargs):
"""Count the number of violations in thie result."""
return sum(path.num_violations(**kwargs) for path in self.paths)
| def num_violations(self):
"""Count the number of violations in thie result."""
return sum(path.num_violations() for path in self.paths)
| https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def persist_changes(self, verbosity=0, output_func=None, **kwargs):
"""Run all the fixes for all the files and return a dict."""
return self.combine_dicts(
*[
path.persist_changes(verbosity=verbosity, output_func=output_func, **kwargs)
for path in self.paths
]
)
| def persist_changes(self, verbosity=0):
"""Run all the fixes for all the files and return a dict."""
return self.combine_dicts(
*[path.persist_changes(verbosity=verbosity) for path in self.paths]
)
| https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def match(self, segments, parse_context):
"""Match a specific sequence of elements."""
if isinstance(segments, BaseSegment):
segments = tuple(segments)
matched_segments = MatchResult.from_empty()
unmatched_segments = segments
for idx, elem in enumerate(self._elements):
while True:
... | def match(self, segments, parse_context):
"""Match a specific sequence of elements."""
if isinstance(segments, BaseSegment):
segments = tuple(segments)
matched_segments = MatchResult.from_empty()
unmatched_segments = segments
for idx, elem in enumerate(self._elements):
while True:
... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def match(self, segments, parse_context):
"""Match if this is a bracketed sequence, with content that matches one of the elements.
1. work forwards to find the first bracket.
If we find something other that whitespace, then fail out.
2. Once we have the first bracket, we need to bracket count forwar... | def match(self, segments, parse_context):
"""Match if this is a bracketed sequence, with content that matches one of the elements.
1. work forwards to find the first bracket.
If we find something other that whitespace, then fail out.
2. Once we have the first bracket, we need to bracket count forwar... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def validate_segments(self, text="constructing", validate=True):
"""Validate the current set of segments.
Check the elements of the `segments` attribute are all
themselves segments, and that the positions match up.
`validate` confirms whether we should check contigiousness.
"""
# Placeholder v... | def validate_segments(self, text="constructing"):
"""Check the elements of the `segments` attribute are all themselves segments."""
for elem in self.segments:
if not isinstance(elem, BaseSegment):
raise TypeError(
"In {0} {1}, found an element of the segments tuple which"
... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def __init__(self, segments, pos_marker=None, validate=True):
if len(segments) == 0:
raise RuntimeError(
"Setting {0} with a zero length segment set. This shouldn't happen.".format(
self.__class__
)
)
if hasattr(segments, "matched_segments"):
# Sa... | def __init__(self, segments, pos_marker=None):
if len(segments) == 0:
raise RuntimeError(
"Setting {0} with a zero length segment set. This shouldn't happen.".format(
self.__class__
)
)
if hasattr(segments, "matched_segments"):
# Safely extract se... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def apply_fixes(self, fixes):
"""Apply an iterable of fixes to this segment.
Used in applying fixes if we're fixing linting errors.
If anything changes, this should return a new version of the segment
rather than mutating the original.
Note: We need to have fixes to apply AND this must have childr... | def apply_fixes(self, fixes):
"""Apply an iterable of fixes to this segment.
Used in applying fixes if we're fixing linting errors.
If anything changes, this should return a new version of the segment
rather than mutating the original.
Note: We need to have fixes to apply AND this must have childr... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def realign(self):
"""Realign the positions in this segment.
Returns:
a copy of this class with the pos_markers realigned.
Note: this is used mostly during fixes.
Realign is recursive. We will assume that the pos_marker of THIS segment is
truthful, and that during recursion it will have b... | def realign(self):
"""Realign the positions in this segment.
Returns:
a copy of this class with the pos_markers realigned.
Note: this is used mostly during fixes.
Realign is recursive. We will assume that the pos_marker of THIS segment is
truthful, and that during recursion it will have b... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def __init__(self, pos_marker):
"""For the indent we override the init method.
For something without content, the content doesn't make
sense. The pos_marker, will be matched with the following
segment, but meta segments are ignored during fixes so it's
ok in this sense. We need the pos marker later... | def __init__(self):
"""For the indent we override the init method.
For something without content, neither makes sense.
"""
self._raw = ""
self.pos_marker = None
| https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def __init__(self, segments, role, indent_balance, indent_impulse=0):
self.segments = segments
self.role = role
self.indent_balance = indent_balance
self.indent_impulse = indent_impulse
| def __init__(self, max_line_length=80, tab_space_size=4, indent_unit="space", **kwargs):
"""Initialise, getting the max line length."""
self.max_line_length = max_line_length
# Call out tab_space_size and indent_unit to make it clear they're still options.
super(Rule_L016, self).__init__(
tab_sp... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def _eval(self, segment, raw_stack, **kwargs):
"""Line is too long.
This only triggers on newline segments, evaluating the whole line.
The detection is simple, the fixing is much trickier.
"""
if segment.name == "newline":
# iterate to buffer the whole line up to this point
this_li... | def _eval(self, segment, raw_stack, **kwargs):
"""Line is too long.
This only triggers on newline segments, evaluating the whole line.
The detection is simple, the fixing is much trickier.
"""
if segment.name == "newline":
# iterate to buffer the whole line up to this point
this_li... | https://github.com/sqlfluff/sqlfluff/issues/132 | $ sqlfluff fix --rules L001 forecastservice\sql\get_phasing_v2.sql
==== finding violations ====
== [forecastservice\sql\get_phasing_v2.sql] FAIL
L: 0 | P: 0 | ???? | Failure in Jinja templating: 'first_mon' is undefined. Have you configured your variables?
L: 7 | P: 1 | ???? | Unable to lex characters: ''{% if ... | TypeError |
def _eval(self, segment, raw_stack, memory, **kwargs):
"""Inconsistent capitalisation of keywords.
We use the `memory` feature here to keep track of
what we've seen in the past.
"""
cases_seen = memory.get("cases_seen", set())
if segment.type == self._target_elem:
raw = segment.raw
... | def _eval(self, segment, raw_stack, memory, **kwargs):
"""Inconsistent capitalisation of keywords.
We use the `memory` feature here to keep track of
what we've seen in the past.
"""
cases_seen = memory.get("cases_seen", set())
if segment.type == self._target_elem:
raw = segment.raw
... | https://github.com/sqlfluff/sqlfluff/issues/87 | ➜ sqlfluff version
0.2.4
➜ echo 'selECT * from table;' > test.sql
➜ sqlfluff fix test.sql --rules L001,L002,L003,L004,L005,L006,L007,L008,L009,L010,L011,L012,L013,L014
==== finding violations ====
Traceback (most recent call last):
File "/Users/nolan/anaconda3/bin/sqlfluff", line 10, in <module>
sys.exit(cli())
File ... | ValueError |
def make_replacement(seg, policy):
"""Make a replacement segment, based on seen capitalisation."""
if policy == "lower":
new_raw = seg.raw.lower()
elif policy == "upper":
new_raw = seg.raw.upper()
elif policy == "capitalize":
new_raw = seg.raw.capitalize()
elif policy == "con... | def make_replacement(seg, policy):
"""Make a replacement segment, based on seen capitalisation."""
if policy == "lower":
new_raw = seg.raw.lower()
elif policy == "upper":
new_raw = seg.raw.upper()
elif policy == "capitalize":
new_raw = seg.raw.capitalize()
elif policy == "con... | https://github.com/sqlfluff/sqlfluff/issues/87 | ➜ sqlfluff version
0.2.4
➜ echo 'selECT * from table;' > test.sql
➜ sqlfluff fix test.sql --rules L001,L002,L003,L004,L005,L006,L007,L008,L009,L010,L011,L012,L013,L014
==== finding violations ====
Traceback (most recent call last):
File "/Users/nolan/anaconda3/bin/sqlfluff", line 10, in <module>
sys.exit(cli())
File ... | ValueError |
def __init__(self, configs=None, overrides=None):
self._overrides = overrides # We only store this for child configs
defaults = ConfigLoader.get_global().load_default_config_file()
self._configs = nested_combine(
defaults, configs or {"core": {}}, {"core": overrides or {}}
)
# Some configs ... | def __init__(self, configs=None, overrides=None):
self._overrides = overrides # We only store this for child configs
defaults = ConfigLoader.get_global().load_default_config_file()
self._configs = nested_combine(
defaults, configs or {"core": {}}, {"core": overrides or {}}
)
# Some configs ... | https://github.com/sqlfluff/sqlfluff/issues/60 | $ sqlfluff version
Traceback (most recent call last):
File "/usr/local/pyenv/versions/3.7.3/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.2.1', 'console_scripts', 'sqlfluff')()
File "/usr/local/pyenv/versions/3.7.3/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*a... | KeyError |
def parse_file(self, f, fname=None, verbosity=0, recurse=True):
violations = []
t0 = get_time()
# Allow f to optionally be a raw string
if isinstance(f, str):
# Add it to a buffer if that's what we're doing
f = StringIO(f)
verbosity_logger("LEXING RAW ({0})".format(fname), verbosit... | def parse_file(self, f, fname=None, verbosity=0, recurse=True):
violations = []
t0 = get_time()
# Allow f to optionally be a raw string
if isinstance(f, str):
# Add it to a buffer if that's what we're doing
f = StringIO(f)
verbosity_logger("LEXING RAW ({0})".format(fname), verbosit... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
"""
Matching can be done from either the raw or the segments.
This raw function can be overridden, or a grammar defined
on the underlying class.
"""
raise NotImplementedError(
"{0} has no match function implemented".format(self.__class__.__name__... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""
Matching can be done from either the raw or the segments.
This raw function can be overridden, or a grammar defined
on the underlying class.
"""
raise NotImp... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def _match(self, segments, parse_context):
"""A wrapper on the match function to do some basic validation"""
t0 = get_time()
if isinstance(segments, BaseSegment):
segments = (segments,) # Make into a tuple for compatability
if not isinstance(segments, tuple):
logging.warning(
... | def _match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""A wrapper on the match function to do some basic validation"""
t0 = get_time()
if isinstance(segments, BaseSegment):
segments = (segments,) # Make into a tuple... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
elem = self._get_elem(dialect=parse_context.dialect)
if elem:
# Match against that. NB We're not incrementing the match_depth here.
# References shouldn't relly count as a depth of match.
return elem._match(
segments=segments,
... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
elem = self._get_elem(dialect=dialect)
if elem:
# Match against that. NB We're not incrementing the match_depth here.
# References shouldn't relly count as a de... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
best_match = None
# Match on each of the options
for opt in self._elements:
m = opt._match(segments, parse_context=parse_context.copy(incr="match_depth"))
# If we get a complete match, just return it. If it's incomplete, then check to
# see i... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
best_match = None
# Match on each of the options
for opt in self._elements:
m = opt._match(
segments,
match_depth=match_depth + 1,
... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
# Match on each of the options
matched_segments = MatchResult.from_empty()
unmatched_segments = segments
n_matches = 0
while True:
if self.max_times and n_matches >= self.max_times:
# We've matched as many times as we can
retu... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
# Match on each of the options
matched_segments = MatchResult.from_empty()
unmatched_segments = segments
n_matches = 0
while True:
if self.max_times and n_ma... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
"""
Matching for GreedyUntil works just how you'd expect.
"""
pre, mat, _ = self._bracket_sensitive_look_ahead_match(
segments,
self._elements,
parse_context=parse_context.copy(incr="match_depth"),
code_only=self.code_only,
)... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""
Matching for GreedyUntil works just how you'd expect.
"""
for idx, seg in enumerate(segments):
for opt in self._elements:
if opt._match(
... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
# Rewrite of sequence. We should match FORWARD, this reduced duplication.
# Sub-matchers should be greedy and so we can jsut work forward with each one.
if isinstance(segments, BaseSegment):
segments = tuple(segments)
# NB: We don't use seg_idx here beca... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
# Rewrite of sequence. We should match FORWARD, this reduced duplication.
# Sub-matchers should be greedy and so we can jsut work forward with each one.
if isinstance(segmen... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def __init__(self, *args, **kwargs):
if "delimiter" not in kwargs:
raise ValueError("Delimited grammars require a `delimiter`")
self.delimiter = kwargs.pop("delimiter")
self.allow_trailing = kwargs.pop("allow_trailing", False)
self.terminator = kwargs.pop("terminator", None)
# Setting min de... | def __init__(self, *args, **kwargs):
if "delimiter" not in kwargs:
raise ValueError("Delimited grammars require a `delimiter`")
self.delimiter = kwargs.pop("delimiter")
self.allow_trailing = kwargs.pop("allow_trailing", False)
self.terminator = kwargs.pop("terminator", None)
# Setting min de... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
# Type munging
if isinstance(segments, BaseSegment):
segments = [segments]
# Have we been passed an empty list?
if len(segments) == 0:
return MatchResult.from_empty()
# Make some buffers
seg_buff = segments
matched_segments = MatchR... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
if isinstance(segments, BaseSegment):
segments = [segments]
seg_idx = 0
terminal_idx = len(segments)
sub_bracket_count = 0
start_bracket_idx = None
# del... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
matched_buffer = tuple()
forward_buffer = segments
while True:
if len(forward_buffer) == 0:
# We're all good
return MatchResult.from_matched(matched_buffer)
elif self.code_only and not forward_buffer[0].is_code:
ma... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
matched_buffer = tuple()
forward_buffer = segments
while True:
if len(forward_buffer) == 0:
# We're all good
return MatchResult.from_matched(... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def __init__(self, target, *args, **kwargs):
self.target = target
self.terminator = kwargs.pop("terminator", None)
super(StartsWith, self).__init__(*args, **kwargs)
| def __init__(self, target, *args, **kwargs):
self.target = target
self.terminator = kwargs.pop("terminator", None)
# The details on how to match a bracket are stored in the dialect
self.start_bracket = Ref("StartBracketSegment")
self.end_bracket = Ref("EndBracketSegment")
super(StartsWith, self)... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
if self.code_only:
first_code_idx = None
# Work through to find the first code segment...
for idx, seg in enumerate(segments):
if seg.is_code:
first_code_idx = idx
break
else:
# We've tr... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
if self.code_only:
first_code_idx = None
# Work through to find the first code segment...
for idx, seg in enumerate(segments):
if seg.is_code:
... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(self, segments, parse_context):
"""The match function for `bracketed` implements bracket counting."""
# 1. work forwards to find the first bracket.
# If we find something other that whitespace, then fail out.
# 2. Once we have the first bracket, we need to bracket count forward to find it'... | def match(
self,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""The match function for `bracketed` implements bracket counting."""
# 1. work forwards to find the first bracket.
# If we find something other that whitespace, then fa... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def __init__(self, config=None):
self.config = config or default_config
self.matcher = RepeatedMultiMatcher(
RegexMatcher.from_shorthand("whitespace", r"[\t ]*"),
RegexMatcher.from_shorthand(
"inline_comment", r"(-- |#)[^\n]*", is_comment=True
),
RegexMatcher.from_sho... | def __init__(self, config=None):
self.config = config or default_config
self.matcher = RepeatedMultiMatcher(
RegexMatcher.from_shorthand("whitespace", r"[\t ]*"),
RegexMatcher.from_shorthand(
"inline_comment", r"(-- |#)[^\n]*", is_comment=True
),
RegexMatcher.from_sho... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def parse_match_logging(grammar, func, msg, parse_context, v_level, **kwargs):
s = "[PD:{0} MD:{1}]\t{2:<50}\t{3:<20}".format(
parse_context.parse_depth,
parse_context.match_depth,
("." * parse_context.match_depth) + str(parse_context.match_segment),
"{0}.{1} {2}".format(grammar, fun... | def parse_match_logging(
parse_depth,
match_depth,
match_segment,
grammar,
func,
msg,
verbosity,
v_level,
**kwargs,
):
s = "[PD:{0} MD:{1}]\t{2:<50}\t{3:<20}".format(
parse_depth,
match_depth,
("." * match_depth) + str(match_segment),
"{0}.{1} {2}"... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def parse(self, parse_context=None):
"""Use the parse kwarg for testing, mostly to check how deep to go.
True/False for yes or no, an integer allows a certain number of levels"""
# We should call the parse grammar on this segment, which calls
# the match grammar on all it's children.
if not parse_... | def parse(self, recurse=True, parse_depth=0, verbosity=0, dialect=None):
"""Use the parse kwarg for testing, mostly to check how deep to go.
True/False for yes or no, an integer allows a certain number of levels"""
# We should call the parse grammar on this segment, which calls
# the match grammar on a... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(cls, segments, parse_context):
"""
Matching can be done from either the raw or the segments.
This raw function can be overridden, or a grammar defined
on the underlying class.
"""
if cls._match_grammar():
# Call the private method
m = cls._match_grammar()._match(
... | def match(
cls,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""
Matching can be done from either the raw or the segments.
This raw function can be overridden, or a grammar defined
on the underlying class.
"""
if cls._match... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def _match(cls, segments, parse_context):
"""A wrapper on the match function to do some basic validation and logging"""
parse_match_logging(
cls.__name__,
"_match",
"IN",
parse_context=parse_context,
v_level=4,
ls=len(segments),
)
if isinstance(segments, ... | def _match(
cls,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""A wrapper on the match function to do some basic validation and logging"""
parse_match_logging(
parse_depth,
match_depth,
match_segment,
cls._... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def expand(segments, parse_context):
segs = tuple()
for stmt in segments:
try:
if not stmt.is_expandable:
logging.info(
"[PD:{0}] Skipping expansion of {1}...".format(
parse_context.parse_depth, stmt
)
... | def expand(segments, recurse=True, parse_depth=0, verbosity=0, dialect=None):
segs = tuple()
for stmt in segments:
try:
if not stmt.is_expandable:
logging.info(
"[PD:{0}] Skipping expansion of {1}...".format(parse_depth, stmt)
)
... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(cls, segments, parse_context):
"""Keyword implements it's own matching function"""
# If we've been passed the singular, make it a list
if isinstance(segments, BaseSegment):
segments = [segments]
# We're only going to match against the first element
if len(segments) >= 1:
r... | def match(
cls,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""Keyword implements it's own matching function"""
# If we've been passed the singular, make it a list
if isinstance(segments, BaseSegment):
segments = [segments]
... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(cls, segments, parse_context):
"""ReSegment implements it's own matching function,
we assume that ._template is a r"" string, and is formatted
for use directly as a regex. This only matches on a single segment."""
# If we've been passed the singular, make it a list
if isinstance(segments, ... | def match(
cls,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""ReSegment implements it's own matching function,
we assume that ._template is a r"" string, and is formatted
for use directly as a regex. This only matches on a single seg... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def match(cls, segments, parse_context):
"""NamedSegment implements it's own matching function,
we assume that ._template is the `name` of a segment"""
# If we've been passed the singular, make it a list
if isinstance(segments, BaseSegment):
segments = [segments]
# We only match on the firs... | def match(
cls,
segments,
match_depth=0,
parse_depth=0,
verbosity=0,
dialect=None,
match_segment=None,
):
"""NamedSegment implements it's own matching function,
we assume that ._template is the `name` of a segment"""
# If we've been passed the singular, make it a list
if isin... | https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def expected_string(cls, dialect=None, called_from=None):
return "!!TODO!!"
| def expected_string(cls, dialect=None, called_from=None):
return "[" + cls._template + "]"
| https://github.com/sqlfluff/sqlfluff/issues/23 | Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv... | TypeError |
def ls(long: bool, dropbox_path: str, include_deleted: bool, config_name: str) -> None:
from datetime import datetime
from .utils import natural_size
if not dropbox_path.startswith("/"):
dropbox_path = "/" + dropbox_path
with MaestralProxy(config_name, fallback=True) as m:
entries = m.... | def ls(long: bool, dropbox_path: str, include_deleted: bool, config_name: str) -> None:
from datetime import datetime
from .utils import natural_size
if not dropbox_path.startswith("/"):
dropbox_path = "/" + dropbox_path
with MaestralProxy(config_name, fallback=True) as m:
entries = m.... | https://github.com/SamSchott/maestral/issues/224 | Traceback (most recent call last):
File "/opt/miniconda3/bin/maestral", line 8, in <module>
sys.exit(main())
File "/opt/miniconda3/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/opt/miniconda3/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = ... | AttributeError |
def check_for_updates():
"""
Checks if updates are available by reading the cached release number from the
config file and notifies the user. Prints an update note to the command line.
"""
from packaging.version import Version
from maestral import __version__
state = MaestralState("maestral... | def check_for_updates():
"""
Checks if updates are available by reading the cached release number from the
config file and notifies the user. Prints an update note to the command line.
"""
from packaging.version import Version
from maestral import __version__
state = MaestralState("maestral... | https://github.com/SamSchott/maestral/issues/136 | Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/click/termui.py", line 498, in style
bits.append("\033[{}m".format(_ansi_colors[fg]))
KeyError: 'orange'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/maestral", line 11, i... | KeyError |
def catch_sync_issues(download=False):
"""
Returns a decorator that catches all SyncErrors and logs them.
Should only be used for methods of UpDownSync.
"""
def decorator(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
try:
res = func(se... | def catch_sync_issues(func):
"""
Decorator that catches all SyncErrors and logs them.
"""
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
try:
res = func(self, *args, **kwargs)
if res is None:
res = True
except SyncError as exc:
... | https://github.com/SamSchott/maestral/issues/131 | Traceback (most recent call last):
File "/home/charles/tf/lib/python3.7/site-packages/maestral/sync.py", line 343, in wrapper
res = func(self, *args, **kwargs)
File "/home/charles/tf/lib/python3.7/site-packages/maestral/sync.py", line 1524, in create_remote_entry
self._on_created(event)
File "/home/charles/tf/lib/pytho... | maestral.errors.PathError |
def wrapper(self, *args, **kwargs):
try:
res = func(self, *args, **kwargs)
if res is None:
res = True
except SyncError as exc:
# fill out missing dbx_path or local_path
if exc.dbx_path or exc.local_path:
if not exc.local_path:
exc.local_pat... | def wrapper(self, *args, **kwargs):
try:
res = func(self, *args, **kwargs)
if res is None:
res = True
except SyncError as exc:
file_name = os.path.basename(exc.dbx_path)
logger.warning("Could not sync %s", file_name, exc_info=True)
if exc.dbx_path is not None:... | https://github.com/SamSchott/maestral/issues/131 | Traceback (most recent call last):
File "/home/charles/tf/lib/python3.7/site-packages/maestral/sync.py", line 343, in wrapper
res = func(self, *args, **kwargs)
File "/home/charles/tf/lib/python3.7/site-packages/maestral/sync.py", line 1524, in create_remote_entry
self._on_created(event)
File "/home/charles/tf/lib/pytho... | maestral.errors.PathError |
def _handle_case_conflict(self, event):
"""
Checks for other items in the same directory with same name but a different
case. Renames items if necessary.Only needed for case sensitive file systems.
:param FileSystemEvent event: Created or moved event.
:returns: ``True`` or ``False``.
:rtype: bo... | def _handle_case_conflict(self, event):
"""
Checks for other items in the same directory with same name but a different
case. Renames items if necessary.Only needed for case sensitive file systems.
:param FileSystemEvent event: Created or moved event.
:returns: ``True`` or ``False``.
:rtype: bo... | https://github.com/SamSchott/maestral/issues/131 | Traceback (most recent call last):
File "/home/charles/tf/lib/python3.7/site-packages/maestral/sync.py", line 343, in wrapper
res = func(self, *args, **kwargs)
File "/home/charles/tf/lib/python3.7/site-packages/maestral/sync.py", line 1524, in create_remote_entry
self._on_created(event)
File "/home/charles/tf/lib/pytho... | maestral.errors.PathError |
def __init__(self, run=True):
self.client = MaestralApiClient()
# periodically check for updates and refresh account info
self.update_thread = Thread(
name="Maestral update check",
target=self._periodic_refresh,
daemon=True,
)
self.update_thread.start()
# monitor needs ... | def __init__(self, run=True):
self.client = MaestralApiClient()
# periodically check for updates and refresh account info
self.update_thread = Thread(
name="Maestral update check",
target=self._periodic_refresh,
daemon=True,
)
self.update_thread.start()
# monitor needs ... | https://github.com/SamSchott/maestral/issues/62 | Oct 22 21:59:54 dolores systemd[1126]: Starting Maestral - a Dropbox clone...
Oct 22 21:59:55 dolores systemd[1126]: Started Maestral - a Dropbox clone.
Oct 22 21:59:55 dolores maestral[5770]: Traceback (most recent call last):
Oct 22 21:59:55 dolores maestral[5770]: File "/nix/store/vrllbj5ial3g70b2wd2bxmx01rxv32yw-... | RuntimeError |
def __str__(self):
return "'{0}': {1}. {2}".format(self.dbx_path, self.title, self.message)
| def __str__(self):
return "{0}: {1}".format(self.title, self.message)
| https://github.com/SamSchott/maestral/issues/39 | dropbox.exceptions.ApiError: ApiError('30f1d5eeaac843c1ff555c04e08561b8', UploadError('path', UploadWriteFailed(reason=WriteError('disallowed_name', None), upload_session_id='AAAAAAAAM9FqZ1pyxzgvlA')))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/nix/s... | maestral.errors.PathError |
def bulk_history_create(self, objs, batch_size=None):
"""Bulk create the history for the objects specified by objs"""
historical_instances = [
self.model(
history_date=getattr(instance, "_history_date", now()),
history_user=getattr(instance, "_history_user", None),
*... | def bulk_history_create(self, objs, batch_size=None):
"""Bulk create the history for the objects specified by objs"""
historical_instances = [
self.model(
history_date=getattr(instance, "_history_date", now()),
history_user=getattr(instance, "_history_user", None),
*... | https://github.com/jazzband/django-simple-history/issues/402 | Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/srv/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/srv/venv/local/lib/python2.7/site-packages/django/core/mana... | TypeError |
def create_history_model(self, model, inherited):
"""
Creates a historical model to associate with the model provided.
"""
attrs = {
"__module__": self.module,
"_history_excluded_fields": self.excluded_fields,
}
app_module = "%s.models" % model._meta.app_label
if inherited:... | def create_history_model(self, model, inherited):
"""
Creates a historical model to associate with the model provided.
"""
attrs = {"__module__": self.module}
app_module = "%s.models" % model._meta.app_label
if inherited:
# inherited use models module
attrs["__module__"] = mode... | https://github.com/jazzband/django-simple-history/issues/402 | Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/srv/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/srv/venv/local/lib/python2.7/site-packages/django/core/mana... | TypeError |
def get_extra_fields(self, model, fields):
"""Return dict of extra fields added to the historical record model"""
user_model = getattr(settings, "AUTH_USER_MODEL", "auth.User")
def revert_url(self):
"""URL for this change in the default admin site."""
opts = model._meta
app_label, ... | def get_extra_fields(self, model, fields):
"""Return dict of extra fields added to the historical record model"""
user_model = getattr(settings, "AUTH_USER_MODEL", "auth.User")
def revert_url(self):
"""URL for this change in the default admin site."""
opts = model._meta
app_label, ... | https://github.com/jazzband/django-simple-history/issues/402 | Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/srv/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/srv/venv/local/lib/python2.7/site-packages/django/core/mana... | TypeError |
def get_instance(self):
attrs = {field.attname: getattr(self, field.attname) for field in fields.values()}
if self._history_excluded_fields:
excluded_attnames = [
model._meta.get_field(field).attname
for field in self._history_excluded_fields
]
values = (
... | def get_instance(self):
return model(
**{field.attname: getattr(self, field.attname) for field in fields.values()}
)
| https://github.com/jazzband/django-simple-history/issues/402 | Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/srv/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/srv/venv/local/lib/python2.7/site-packages/django/core/mana... | TypeError |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the HomeMatic binary sensor platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
if discovery_info[ATTR_DISCOVERY_TYPE] == DISCOVER_BATTERY:
... | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the HomeMatic binary sensor platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
if discovery_info[ATTR_DISCOVERY_TYPE] == DISCOVER_BATTERY:
... | https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Homematic thermostat platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMThermostat(conf)
devices.append(new_device)
... | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Homematic thermostat platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMThermostat(conf)
devices.append(new_device)
... | https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMCover(conf)
devices.append(new_device)
add_entities(devices, True... | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMCover(conf)
devices.append(new_device)
add_entities(devices)
| https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def _init_data_struct(self):
"""Generate a data dictionary (self._data) from metadata."""
self._state = "LEVEL"
self._data.update({self._state: None})
if "LEVEL_2" in self._hmdevice.WRITENODE:
self._data.update({"LEVEL_2": None})
| def _init_data_struct(self):
"""Generate a data dictionary (self._data) from metadata."""
self._state = "LEVEL"
self._data.update({self._state: STATE_UNKNOWN})
if "LEVEL_2" in self._hmdevice.WRITENODE:
self._data.update({"LEVEL_2": STATE_UNKNOWN})
| https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Homematic light platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMLight(conf)
devices.append(new_device)
add_entiti... | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Homematic light platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMLight(conf)
devices.append(new_device)
add_entiti... | https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Homematic lock platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
devices.append(HMLock(conf))
add_entities(devices, True)
| def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Homematic lock platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
devices.append(HMLock(conf))
add_entities(devices)
| https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def _init_data_struct(self):
"""Generate the data dictionary (self._data) from metadata."""
self._state = "STATE"
self._data.update({self._state: None})
| def _init_data_struct(self):
"""Generate the data dictionary (self._data) from metadata."""
self._state = "STATE"
self._data.update({self._state: STATE_UNKNOWN})
| https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the HomeMatic sensor platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMSensor(conf)
devices.append(new_device)
add_enti... | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the HomeMatic sensor platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMSensor(conf)
devices.append(new_device)
add_enti... | https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def _init_data_struct(self):
"""Generate a data dictionary (self._data) from metadata."""
if self._state:
self._data.update({self._state: None})
else:
_LOGGER.critical("Unable to initialize sensor: %s", self._name)
| def _init_data_struct(self):
"""Generate a data dictionary (self._data) from metadata."""
if self._state:
self._data.update({self._state: STATE_UNKNOWN})
else:
_LOGGER.critical("Unable to initialize sensor: %s", self._name)
| https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the HomeMatic switch platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMSwitch(conf)
devices.append(new_device)
add_enti... | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the HomeMatic switch platform."""
if discovery_info is None:
return
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
new_device = HMSwitch(conf)
devices.append(new_device)
add_enti... | https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
def _init_data_struct(self):
"""Generate the data dictionary (self._data) from metadata."""
self._state = "STATE"
self._data.update({self._state: None})
# Need sensor values for SwitchPowermeter
for node in self._hmdevice.SENSORNODE:
self._data.update({node: None})
| def _init_data_struct(self):
"""Generate the data dictionary (self._data) from metadata."""
self._state = "STATE"
self._data.update({self._state: STATE_UNKNOWN})
# Need sensor values for SwitchPowermeter
for node in self._hmdevice.SENSORNODE:
self._data.update({node: STATE_UNKNOWN})
| https://github.com/home-assistant/core/issues/30736 | Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 179, i... | AttributeError |
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up PS4 from a config entry."""
config = config_entry
creds = config.data[CONF_TOKEN]
device_list = []
for device in config.data["devices"]:
host = device[CONF_HOST]
region = device[CONF_REGION]
name =... | async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up PS4 from a config entry."""
config = config_entry
await async_setup_platform(hass, config, async_add_entities, discovery_info=None)
| https://github.com/home-assistant/core/issues/25665 | Error while setting up platform ps4
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 146, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
retu... | AttributeError |
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Not Implemented."""
pass
| async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up PS4 Platform."""
creds = config.data[CONF_TOKEN]
device_list = []
for device in config.data["devices"]:
host = device[CONF_HOST]
region = device[CONF_REGION]
name = device[CONF_NAME]
... | https://github.com/home-assistant/core/issues/25665 | Error while setting up platform ps4
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 146, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
retu... | AttributeError |
async def async_setup_entry(hass, config_entry):
"""Set up TPLink from a config entry."""
from pyHS100 import SmartBulb, SmartPlug, SmartDeviceException
devices = {}
config_data = hass.data[DOMAIN].get(ATTR_CONFIG)
# These will contain the initialized devices
lights = hass.data[DOMAIN][CONF_L... | async def async_setup_entry(hass, config_entry):
"""Set up TPLink from a config entry."""
from pyHS100 import SmartBulb, SmartPlug, SmartDeviceException
devices = {}
config_data = hass.data[DOMAIN].get(ATTR_CONFIG)
# These will contain the initialized devices
lights = hass.data[DOMAIN][CONF_L... | https://github.com/home-assistant/core/issues/21725 | 2019-03-07 01:08:44 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry TP-Link Smart Home for tplink
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyHS100/smartdevice.py", line 116, in _query_helper
request=request,
File "/usr/local/lib/python3.7/site-packages/pyH... | OSError |
def _fill_device_lists():
for dev in devices.values():
if isinstance(dev, SmartPlug):
try:
if dev.is_dimmable: # Dimmers act as lights
lights.append(dev)
else:
switches.append(dev)
except SmartDeviceException as... | def _fill_device_lists():
for dev in devices.values():
if isinstance(dev, SmartPlug):
if dev.is_dimmable: # Dimmers act as lights
lights.append(dev)
else:
switches.append(dev)
elif isinstance(dev, SmartBulb):
lights.append(dev)
... | https://github.com/home-assistant/core/issues/21725 | 2019-03-07 01:08:44 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry TP-Link Smart Home for tplink
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyHS100/smartdevice.py", line 116, in _query_helper
request=request,
File "/usr/local/lib/python3.7/site-packages/pyH... | OSError |
def __init__(self, device, device_type, xiaomi_hub):
"""Initialize the Xiaomi device."""
self._state = None
self._is_available = True
self._sid = device["sid"]
self._name = "{}_{}".format(device_type, self._sid)
self._type = device_type
self._write_to_hub = xiaomi_hub.write_to_hub
self._... | def __init__(self, device, device_type, xiaomi_hub):
"""Initialize the Xiaomi device."""
self._state = None
self._is_available = True
self._sid = device["sid"]
self._name = "{}_{}".format(device_type, self._sid)
self._type = device_type
self._write_to_hub = xiaomi_hub.write_to_hub
self._... | https://github.com/home-assistant/core/issues/13522 | 2018-03-29 03:47:13 ERROR (Thread-7) [miio.device] Unable to discover a device at address 192.168.10.213
2018-03-29 03:47:13 ERROR (MainThread) [homeassistant.components.fan] Error while setting up platform smart_mi_fan
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistan... | miio.device.DeviceException |
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Perform the setup for Xiaomi devices."""
devices = []
for _, gateway in hass.data[PY_XIAOMI_GATEWAY].gateways.items():
for device in gateway.devices["cover"]:
model = device["model"]
if model == "curtain"... | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Perform the setup for Xiaomi devices."""
devices = []
for _, gateway in hass.data[PY_XIAOMI_GATEWAY].gateways.items():
for device in gateway.devices["cover"]:
model = device["model"]
if model == "curtain"... | https://github.com/home-assistant/core/issues/13522 | 2018-03-29 03:47:13 ERROR (Thread-7) [miio.device] Unable to discover a device at address 192.168.10.213
2018-03-29 03:47:13 ERROR (MainThread) [homeassistant.components.fan] Error while setting up platform smart_mi_fan
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistan... | miio.device.DeviceException |
def close_cover(self, **kwargs):
"""Close the cover."""
self._write_to_hub(self._sid, **{self._data_key: "close"})
| def close_cover(self, **kwargs):
"""Close the cover."""
self._write_to_hub(self._sid, **{self._data_key["status"]: "close"})
| https://github.com/home-assistant/core/issues/13522 | 2018-03-29 03:47:13 ERROR (Thread-7) [miio.device] Unable to discover a device at address 192.168.10.213
2018-03-29 03:47:13 ERROR (MainThread) [homeassistant.components.fan] Error while setting up platform smart_mi_fan
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistan... | miio.device.DeviceException |
def open_cover(self, **kwargs):
"""Open the cover."""
self._write_to_hub(self._sid, **{self._data_key: "open"})
| def open_cover(self, **kwargs):
"""Open the cover."""
self._write_to_hub(self._sid, **{self._data_key["status"]: "open"})
| https://github.com/home-assistant/core/issues/13522 | 2018-03-29 03:47:13 ERROR (Thread-7) [miio.device] Unable to discover a device at address 192.168.10.213
2018-03-29 03:47:13 ERROR (MainThread) [homeassistant.components.fan] Error while setting up platform smart_mi_fan
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistan... | miio.device.DeviceException |
def stop_cover(self, **kwargs):
"""Stop the cover."""
self._write_to_hub(self._sid, **{self._data_key: "stop"})
| def stop_cover(self, **kwargs):
"""Stop the cover."""
self._write_to_hub(self._sid, **{self._data_key["status"]: "stop"})
| https://github.com/home-assistant/core/issues/13522 | 2018-03-29 03:47:13 ERROR (Thread-7) [miio.device] Unable to discover a device at address 192.168.10.213
2018-03-29 03:47:13 ERROR (MainThread) [homeassistant.components.fan] Error while setting up platform smart_mi_fan
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistan... | miio.device.DeviceException |
def set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""
position = kwargs.get(ATTR_POSITION)
self._write_to_hub(self._sid, **{ATTR_CURTAIN_LEVEL: str(position)})
| def set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""
position = kwargs.get(ATTR_POSITION)
self._write_to_hub(self._sid, **{self._data_key["pos"]: str(position)})
| https://github.com/home-assistant/core/issues/13522 | 2018-03-29 03:47:13 ERROR (Thread-7) [miio.device] Unable to discover a device at address 192.168.10.213
2018-03-29 03:47:13 ERROR (MainThread) [homeassistant.components.fan] Error while setting up platform smart_mi_fan
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistan... | miio.device.DeviceException |
def setup_cors(app, origins):
"""Setup cors."""
import aiohttp_cors
cors = aiohttp_cors.setup(
app,
defaults={
host: aiohttp_cors.ResourceOptions(
allow_headers=ALLOWED_CORS_HEADERS,
allow_methods="*",
)
for host in origins... | def setup_cors(app, origins):
"""Setup cors."""
import aiohttp_cors
cors = aiohttp_cors.setup(
app,
defaults={
host: aiohttp_cors.ResourceOptions(
allow_headers=ALLOWED_CORS_HEADERS,
allow_methods="*",
)
for host in origins... | https://github.com/home-assistant/core/issues/15659 | 2018-07-24 20:02:02 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/http/__init__.py", line 132, in start_server
await server.start()
File "/usr/src/app/homeassistant/components/http/__init__.py", ... | ValueError |
async def cors_startup(app):
"""Initialize cors when app starts up."""
for route in list(app.router.routes()):
_allow_cors(route)
| async def cors_startup(app):
"""Initialize cors when app starts up."""
cors_added = set()
for route in list(app.router.routes()):
if hasattr(route, "resource"):
route = route.resource
if route in cors_added:
continue
cors.add(route)
cors_added.add(rou... | https://github.com/home-assistant/core/issues/15659 | 2018-07-24 20:02:02 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/http/__init__.py", line 132, in start_server
await server.start()
File "/usr/src/app/homeassistant/components/http/__init__.py", ... | ValueError |
def register(self, app, router):
"""Register the view with a router."""
assert self.url is not None, "No url set for view"
urls = [self.url] + self.extra_urls
routes = []
for method in ("get", "post", "delete", "put"):
handler = getattr(self, method, None)
if not handler:
... | def register(self, app, router):
"""Register the view with a router."""
assert self.url is not None, "No url set for view"
urls = [self.url] + self.extra_urls
routes = []
for method in ("get", "post", "delete", "put"):
handler = getattr(self, method, None)
if not handler:
... | https://github.com/home-assistant/core/issues/15659 | 2018-07-24 20:02:02 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/http/__init__.py", line 132, in start_server
await server.start()
File "/usr/src/app/homeassistant/components/http/__init__.py", ... | ValueError |
def __init__(self, hass, config):
"""Initialize."""
super().__init__()
self._extra_arguments = config.get(CONF_FFMPEG_ARGUMENTS)
self._last_image = None
self._last_url = None
self._manager = hass.data[DATA_FFMPEG]
self._name = config[CONF_NAME]
self.host = config[CONF_HOST]
self.port... | def __init__(self, hass, config):
"""Initialize."""
super().__init__()
self._extra_arguments = config.get(CONF_FFMPEG_ARGUMENTS)
self._ftp = None
self._last_image = None
self._last_url = None
self._manager = hass.data[DATA_FFMPEG]
self._name = config[CONF_NAME]
self.host = config[CON... | https://github.com/home-assistant/core/issues/15108 | Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 474, in send_camera_still
image = await async_get_image(hass, msg['entity_id'])
File "/usr/lib/python3.6/si... | BrokenPipeError |
def _recursive_merge(conf, package):
"""Merge package into conf, recursively."""
error = False
for key, pack_conf in package.items():
if isinstance(pack_conf, dict):
if not pack_conf:
continue
conf[key] = conf.get(key, OrderedDict())
error = _recur... | def _recursive_merge(pack_name, comp_name, config, conf, package):
"""Merge package into conf, recursively."""
for key, pack_conf in package.items():
if isinstance(pack_conf, dict):
if not pack_conf:
continue
conf[key] = conf.get(key, OrderedDict())
_r... | https://github.com/home-assistant/core/issues/14906 | 2018-06-10 00:27:15 INFO (SyncWorker_0) [homeassistant.config] Upgrading configuration directory from 0.70.1 to 0.71.0
2018-06-10 00:27:15 INFO (SyncWorker_0) [homeassistant.config] Migrating old system configuration files to new locations
2018-06-10 00:27:15 INFO (MainThread) [homeassistant.loader] Loaded device_track... | AttributeError |
def merge_packages_config(hass, config, packages, _log_pkg_error=_log_pkg_error):
"""Merge packages into the top-level configuration. Mutate config."""
# pylint: disable=too-many-nested-blocks
PACKAGES_CONFIG_SCHEMA(packages)
for pack_name, pack_conf in packages.items():
for comp_name, comp_conf... | def merge_packages_config(hass, config, packages, _log_pkg_error=_log_pkg_error):
"""Merge packages into the top-level configuration. Mutate config."""
# pylint: disable=too-many-nested-blocks
PACKAGES_CONFIG_SCHEMA(packages)
for pack_name, pack_conf in packages.items():
for comp_name, comp_conf... | https://github.com/home-assistant/core/issues/14906 | 2018-06-10 00:27:15 INFO (SyncWorker_0) [homeassistant.config] Upgrading configuration directory from 0.70.1 to 0.71.0
2018-06-10 00:27:15 INFO (SyncWorker_0) [homeassistant.config] Migrating old system configuration files to new locations
2018-06-10 00:27:15 INFO (MainThread) [homeassistant.loader] Loaded device_track... | AttributeError |
async def async_setup(hass, config):
"""Setup configured zones as well as home assistant zone if necessary."""
hass.data[DOMAIN] = {}
entities = set()
zone_entries = configured_zones(hass)
for _, entry in config_per_platform(config, DOMAIN):
if slugify(entry[CONF_NAME]) not in zone_entries:
... | async def async_setup(hass, config):
"""Setup configured zones as well as home assistant zone if necessary."""
if DOMAIN not in hass.data:
hass.data[DOMAIN] = {}
zone_entries = configured_zones(hass)
for _, entry in config_per_platform(config, DOMAIN):
name = slugify(entry[CONF_NAME])
... | https://github.com/home-assistant/core/issues/14396 | Error during setup of component zone
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
result = await component.async_setup(hass, processed_config)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/compon... | TypeError |
def update_as_of(self, utc_point_in_time):
"""Calculate sun state at a point in UTC time."""
import astral
mod = -1
while True:
try:
next_rising_dt = self.location.sunrise(
utc_point_in_time + timedelta(days=mod), local=False
)
if next_rising_... | def update_as_of(self, utc_point_in_time):
"""Calculate sun state at a point in UTC time."""
mod = -1
while True:
next_rising_dt = self.location.sunrise(
utc_point_in_time + timedelta(days=mod), local=False
)
if next_rising_dt > utc_point_in_time:
break
... | https://github.com/home-assistant/core/issues/2090 | 16-05-16 15:41:28 homeassistant.bootstrap: Error during setup of component sun
Traceback (most recent call last):
File "/home/vidar/.homeassistant/deps/astral.py", line 1464, in sunrise_utc
return self._calc_time(90 + 0.833, SUN_RISING, date, latitude, longitude)
File "/home/vidar/.homeassistant/deps/astral.py", line 2... | ValueError |
def detect_location_info():
"""Detect location information."""
try:
raw_info = requests.get("https://freegeoip.net/json/", timeout=5).json()
except (requests.RequestException, ValueError):
return None
data = {key: raw_info.get(key) for key in LocationInfo._fields}
# From Wikipedia:... | def detect_location_info():
"""Detect location information."""
try:
raw_info = requests.get("https://freegeoip.net/json/", timeout=5).json()
except requests.RequestException:
return
data = {key: raw_info.get(key) for key in LocationInfo._fields}
# From Wikipedia: Fahrenheit is used... | https://github.com/home-assistant/core/issues/1378 | C:\Users\fredr>py -m homeassistant --open-ui
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\fredr\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 106, in spawn_main
exitcode = main(fd)
File "C:\Users\fredr\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn... | AttributeError |
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"""Setup the RFXtrx platform."""
import RFXtrx as rfxtrxmod
lights = []
devices = config.get("devices", None)
if devices:
for entity_id, entity_info in devices.items():
if entity_id not in rfxtrx.RFX_D... | def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"""Setup the RFXtrx platform."""
import RFXtrx as rfxtrxmod
lights = []
devices = config.get("devices", None)
if devices:
for entity_id, entity_info in devices.items():
if entity_id not in rfxtrx.RFX_D... | https://github.com/home-assistant/core/issues/1116 | INFO:homeassistant.components.rfxtrx:Receive RFXCOM event from <class 'RFXtrx.LightingDevice'> type='LightwaveRF, Siemens' id='f11043:16' => f1104316 : 0a140005f1104310050050
INFO:homeassistant.components.switch.rfxtrx:Automatic add f1104316 rfxtrx.switch (Class: LightingDevice Sub: 0)
INFO:homeassistant.core:Bus:Handl... | KeyError |
def light_update(event):
"""Callback for light updates from the RFXtrx gateway."""
if not isinstance(event.device, rfxtrxmod.LightDevice):
return
# Add entity if not exist and the automatic_add is True
entity_id = slugify(event.device.id_string.lower())
if entity_id not in rfxtrx.RFX_DEVICE... | def light_update(event):
"""Callback for light updates from the RFXtrx gateway."""
if not isinstance(event.device, rfxtrxmod.LightingDevice):
return
# Add entity if not exist and the automatic_add is True
entity_id = slugify(event.device.id_string.lower())
if entity_id not in rfxtrx.RFX_DEV... | https://github.com/home-assistant/core/issues/1116 | INFO:homeassistant.components.rfxtrx:Receive RFXCOM event from <class 'RFXtrx.LightingDevice'> type='LightwaveRF, Siemens' id='f11043:16' => f1104316 : 0a140005f1104310050050
INFO:homeassistant.components.switch.rfxtrx:Automatic add f1104316 rfxtrx.switch (Class: LightingDevice Sub: 0)
INFO:homeassistant.core:Bus:Handl... | KeyError |
def setup(hass, config):
"""Setup the RFXtrx component."""
# Declare the Handle event
def handle_receive(event):
"""Callback all subscribers for RFXtrx gateway."""
# Log RFXCOM event
if not event.device.id_string:
return
entity_id = slugify(event.device.id_strin... | def setup(hass, config):
"""Setup the RFXtrx component."""
# Declare the Handle event
def handle_receive(event):
"""Callback all subscribers for RFXtrx gateway."""
# Log RFXCOM event
entity_id = slugify(event.device.id_string.lower())
packet_id = "".join("{0:02x}".format(x)... | https://github.com/home-assistant/core/issues/1116 | INFO:homeassistant.components.rfxtrx:Receive RFXCOM event from <class 'RFXtrx.LightingDevice'> type='LightwaveRF, Siemens' id='f11043:16' => f1104316 : 0a140005f1104310050050
INFO:homeassistant.components.switch.rfxtrx:Automatic add f1104316 rfxtrx.switch (Class: LightingDevice Sub: 0)
INFO:homeassistant.core:Bus:Handl... | KeyError |
def handle_receive(event):
"""Callback all subscribers for RFXtrx gateway."""
# Log RFXCOM event
if not event.device.id_string:
return
entity_id = slugify(event.device.id_string.lower())
packet_id = "".join("{0:02x}".format(x) for x in event.data)
entity_name = "%s : %s" % (entity_id, p... | def handle_receive(event):
"""Callback all subscribers for RFXtrx gateway."""
# Log RFXCOM event
entity_id = slugify(event.device.id_string.lower())
packet_id = "".join("{0:02x}".format(x) for x in event.data)
entity_name = "%s : %s" % (entity_id, packet_id)
_LOGGER.info("Receive RFXCOM event f... | https://github.com/home-assistant/core/issues/1116 | INFO:homeassistant.components.rfxtrx:Receive RFXCOM event from <class 'RFXtrx.LightingDevice'> type='LightwaveRF, Siemens' id='f11043:16' => f1104316 : 0a140005f1104310050050
INFO:homeassistant.components.switch.rfxtrx:Automatic add f1104316 rfxtrx.switch (Class: LightingDevice Sub: 0)
INFO:homeassistant.core:Bus:Handl... | KeyError |
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"""Setup the RFXtrx platform."""
import RFXtrx as rfxtrxmod
# Add switch from config file
switchs = []
devices = config.get("devices")
if devices:
for entity_id, entity_info in devices.items():
if e... | def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"""Setup the RFXtrx platform."""
import RFXtrx as rfxtrxmod
# Add switch from config file
switchs = []
devices = config.get("devices")
if devices:
for entity_id, entity_info in devices.items():
if e... | https://github.com/home-assistant/core/issues/1116 | INFO:homeassistant.components.rfxtrx:Receive RFXCOM event from <class 'RFXtrx.LightingDevice'> type='LightwaveRF, Siemens' id='f11043:16' => f1104316 : 0a140005f1104310050050
INFO:homeassistant.components.switch.rfxtrx:Automatic add f1104316 rfxtrx.switch (Class: LightingDevice Sub: 0)
INFO:homeassistant.core:Bus:Handl... | KeyError |
def switch_update(event):
"""Callback for sensor updates from the RFXtrx gateway."""
if not isinstance(event.device, rfxtrxmod.SwitchDevice) or isinstance(
event.device, rfxtrxmod.LightDevice
):
return
# Add entity if not exist and the automatic_add is True
entity_id = slugify(event... | def switch_update(event):
"""Callback for sensor updates from the RFXtrx gateway."""
if not isinstance(event.device, rfxtrxmod.LightingDevice):
return
# Add entity if not exist and the automatic_add is True
entity_id = slugify(event.device.id_string.lower())
if entity_id not in rfxtrx.RFX_D... | https://github.com/home-assistant/core/issues/1116 | INFO:homeassistant.components.rfxtrx:Receive RFXCOM event from <class 'RFXtrx.LightingDevice'> type='LightwaveRF, Siemens' id='f11043:16' => f1104316 : 0a140005f1104310050050
INFO:homeassistant.components.switch.rfxtrx:Automatic add f1104316 rfxtrx.switch (Class: LightingDevice Sub: 0)
INFO:homeassistant.core:Bus:Handl... | KeyError |
def run(self):
"""Intentionally terminating the process with an error code."""
sys.exit(-1)
| def run(self):
"""Do nothing so the command intentionally fails."""
pass
| https://github.com/Qiskit/qiskit/issues/78 | Building wheels for collected packages: qiskit
Building wheel for qiskit (setup.py) ... done
Exception:
Traceback (most recent call last):
File "/home/ima/envs/test/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 179, in main
status = self.run(options, args)
File "/home/ima/envs/test/lib/python3.6/... | IndexError |
async def write(self, uuid):
p = f"{self.path}/{uuid}.{self.count[uuid]}"
async with AIOFile(p, mode="a") as fp:
r = await fp.write("\n".join(self.data[uuid]) + "\n", offset=self.pointer[uuid])
self.pointer[uuid] += r
self.data[uuid] = []
if self.pointer[uuid] >= self.rotate:
... | async def write(self, uuid):
p = f"{self.path}/{uuid}.{self.count[uuid]}"
async with AIOFile(p, mode="a") as fp:
r = await fp.write("\n".join(self.data[uuid]) + "\n", offset=self.pointer[uuid])
self.pointer[uuid] += len(r)
self.data[uuid] = []
if self.pointer[uuid] >= self.rotate:
... | https://github.com/bmoscon/cryptofeed/issues/282 | 2020-08-23 14:18:45,985 : ERROR : COINBASE: encountered an exception, reconnecting
Traceback (most recent call last):
File "/home/g/.local/lib/python3.8/site-packages/cryptofeed/feedhandler.py", line 211, in _connect
await self._handler(websocket, feed.message_handler, feed.uuid)
File "/home/g/.local/lib/python3.8/site... | TypeError |
def run_module(self):
import runpy
code = "run_module(modname, alter_sys=True)"
global_dict = {"run_module": runpy.run_module, "modname": self.options.module}
sys.argv = [self.options.module] + self.command[:]
sys.path.append(os.getcwd())
return self.run_code(code, global_dict)
| def run_module(self):
import runpy
code = "run_module(modname, run_name='__main__')"
global_dict = {"run_module": runpy.run_module, "modname": self.options.module}
sys.argv = [self.options.module] + self.command[:]
sys.path.append(os.getcwd())
return self.run_code(code, global_dict)
| https://github.com/gaogaotiantian/viztracer/issues/58 | viztracer --log_multiprocess -m sushy.indexer
date=2020-12-06T12:49:12.350 pid=8953 level=WARNING filename=models.py:129:init_db msg="virtual tables may not be indexed"
date=2020-12-06T12:49:12.360 pid=8953 level=INFO filename=indexer.py:258:<module> msg="Scanning /home/rcarmo/Sites/taoofmac.com/space, static rendering... | _pickle.PicklingError |
def ignore_function(method=None, tracer=None):
def inner(func):
@functools.wraps(func)
def ignore_wrapper(*args, **kwargs):
# We need this to keep trace a local variable
t = tracer
if not t:
t = get_tracer()
if not t:
... | def ignore_function(method=None, tracer=None):
if not tracer:
tracer = get_tracer()
def inner(func):
@functools.wraps(func)
def ignore_wrapper(*args, **kwargs):
tracer.pause()
ret = func(*args, **kwargs)
tracer.resume()
return ret
... | https://github.com/gaogaotiantian/viztracer/issues/42 | Traceback (most recent call last):
File "C:/Users/PycharmProjects/oneway_test/test.py", line 12, in <module>
f()
File "D:\virtual\Envs\venv37\lib\site-packages\viztracer\decorator.py", line 17, in ignore_wrapper
tracer.pause()
AttributeError: 'NoneType' object has no attribute 'pause' | AttributeError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.