Exception in logger while using query options

36 views
Skip to first unread message

Ofir Herzas

unread,
Oct 14, 2015, 5:34:04 AM10/14/15
to sqlalchemy
An exception pertaining to the logger is raised when using query.options
Here is the relevant part of the exception:

    query = query.options(sqlalchemy.orm.load_only(*properties))
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/query.py", line 1100, in options
    return self._options(False, *args)
  File "<string>", line 2, in _options
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/base.py", line 201, in generate
    fn(self, *args[1:], **kw)
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/query.py", line 1117, in _options
    opt.process_query(self)
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/strategy_options.py", line 95, in process_query
    self._process(query, True)
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/strategy_options.py", line 305, in _process
    val._bind_loader(query, query._attributes, raiseerr)
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/strategy_options.py", line 422, in _bind_loader
    effective_path.set(context, "loader", loader)
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/path_registry.py", line 63, in set
    log.debug("set '%s' on path '%s' to '%s'", key, self, value)
  File "/usr/local/lib/python3.3/logging/__init__.py", line 1225, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python3.3/logging/__init__.py", line 1372, in _log
    self.handle(record)
  File "/usr/local/lib/python3.3/logging/__init__.py", line 1382, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.3/logging/__init__.py", line 1444, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.3/logging/__init__.py", line 835, in handle
    self.emit(record)
  File "/usr/local/lib/python3.3/logging/handlers.py", line 869, in emit
    msg = self.format(record)
  File "/usr/local/lib/python3.3/logging/__init__.py", line 810, in format
    return fmt.format(record)
  File "/opt/enigmai/6.0-test/server/handlers/LogFormatter.py", line 77, in format
    return super(LogFormatter, self).format(record)
  File "/usr/local/lib/python3.3/logging/__init__.py", line 548, in format
    record.message = record.getMessage()
  File "/usr/local/lib/python3.3/logging/__init__.py", line 311, in getMessage
    msg = msg % self.args
  File "/opt/enigmai/ve/python-3.3.4/lib/python3.3/site-packages/sqlalchemy/orm/strategy_options.py", line 183, in __str__
    return "Load(strategy=%r)" % self.strategy
TypeError: not all arguments converted during string formatting

Ofir Herzas

unread,
Oct 14, 2015, 5:36:36 AM10/14/15
to sqlalchemy
BTW: sqlalchemy 1.0.8, python 3.3.4

Mike Bayer

unread,
Oct 14, 2015, 9:31:05 AM10/14/15
to sqlal...@googlegroups.com


On 10/14/15 5:34 AM, Ofir Herzas wrote:
> An exception pertaining to the logger is raised when using query.options
>
> Here is the relevant part of the exception:

issue 3539 fixed for 1.0.9:

https://bitbucket.org/zzzeek/sqlalchemy/issues/3539
> --
> You received this message because you are subscribed to the Google
> Groups "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sqlalchemy+...@googlegroups.com
> <mailto:sqlalchemy+...@googlegroups.com>.
> To post to this group, send email to sqlal...@googlegroups.com
> <mailto:sqlal...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

Ofir Herzas

unread,
Oct 14, 2015, 1:38:08 PM10/14/15
to sqlal...@googlegroups.com

Thank you Mike for your fast response.

I found another thing regarding the options though I'm not sure if it's a bug or not.

I have a model with a property concatenating 2 string columns.
When I queried the model supplying this property I got an exception (don't recall the exact exception though it should be easy to reproduce).

I know this property is not a column, hence is why I imagine it could be right...

You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy/_MOuFxMWfg8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages