Coder Social home page Coder Social logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I have been stepping through the source code trying to fix this issue myself, 
and so far I have worked out the following:

1. The Row object is dynamically created with the list of fields (using the 
recordtype module)
2. This field list is empty, it gets populated from the _Col
3. When I run a query using MutableNamedTupleRow, Cursor._ColBufferList does 
not get correctly populated. This means that the Row object does not get 
created properly.

Is this likely to be fixed any time soon? I don't really know enough about the 
low-level portions of the pypyodbc code to fix the _ColBufferList.

It might be possible to use the Cursor.description list to create the Row 
object instead; I'm not sure.

Original comment by [email protected] on 21 May 2014 at 7:52

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I believe that what I said in my previous comment is correct; 
Cursor._ColBufferList is not getting populated properly when a query is 
executed.

I fixed this by modifying the _UpdateDesc function a bit, although I still need 
to run tests to make sure that it doesn't break anything else. Basically, I 
just moved the following line to the *end* of the function, instead of it being 
inside the if statement:

self._row_type = self.row_type_callable(self)

This forces the Row object to be created *after* the _ColBufferList is 
populated, which fixes the TypeError exception with NamedTupleRow and 
MutableNamedTupleRow.

I'll try to submit some kind of patch, but this really is just a one line 
change.

Original comment by [email protected] on 24 Sep 2014 at 7:08

from pypyodbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.