Hi Mike,
I'll see if I can separate the specific DataFrame that was causing the
problem.
Thanks,
Rob
On Tuesday, May 11, 2021 at 7:42:28 PM UTC-4 Mike Bayer wrote:
> this does mean there's a bug in the mariadb driver, if you can provide a
> reproducing test case
>
>
> On Tu
Hi Mike,
Apparently it was the driver. I changed the create_engine to:
engine = create_engine('mysql://user:password@127.0.0.1/options')
And that appears to handle that particular insert without issue.
Thank-you,
Rob
On Tuesday, May 11, 2021 at 10:41:13 AM UTC-4 Mike Bayer wrote:
>
=
create_engine('mariadb+mariadbconnector://user:password@127.0.0.1/options')
The original data collected is returned as a Python dictionary, and I
convert each of the rows of calls/puts by expiration date to a Pandas data
frame and use to_sql() to update the database.
Thank-you,
Rob
to access a property named "1st_period" yields a SyntaxError
Thanks,
Rob
SELECT TOP 10 [1st_period] FROM Students;
class Student(Model):
__table__ = Table("Students", metadata, autoload=True, autoload_with=engine)
@property
def first_period(self):
return self.1st_period
--
).join(Student.details)
>
> the different ways to join are laid out at
>
>
> https://docs.sqlalchemy.org/en/13/orm/query.html?highlight=query%20join#sqlalchemy.orm.query.Query.join
>
>
>
> On Tue, Jul 21, 2020, at 9:40 PM, Rob Rosenfeld wrote:
>
>
> Hi All,
>
>
are
autoloaded from the database schema. I've been doing fine until I hit this
association object pattern. Can you please offer any advice?
Thanks,
Rob
In the end my goal is to execute the following and have it issue a single
statement to the database.
results =
Class.query.join(Enrollment
I'm trying to do "alembic revision --autogenerate"
I get the usual warnings (that I've gotten in previous successful runs)
Here's the console output
alembic$ alembic revision --autogenerate
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will
.__data_cache.get(self.id)
if data is None:
User.__data_cache[self.id] = 0
User.__data_cache[self.id] += 1
Rob
On Wednesday, February 12, 2020 at 9:43:37 PM UTC-6, Rob Rosenfeld wrote:
>
> Thanks for the thoughts. I'm going to digest, read docs, and experiment.
>
>
> On We
Thanks for the thoughts. I'm going to digest, read docs, and experiment.
On Wed, Feb 12, 2020 at 8:52 AM Mike Bayer wrote:
>
>
> On Tue, Feb 11, 2020, at 11:41 PM, Rob Rosenfeld wrote:
>
> Hi All,
>
> I am using Flask-SQLAlchemy on a legacy database. My SQLA classes
plain old
python.
Thanks for the help,
Rob
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import MetaData
from sqlalchemy import orm
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = connection_string
db = SQLAlchemy(app)
class Owne
Server]Statement(s) could not be prepared. (8180)
> > (SQLExecDirectW)')[SQL:'SELECT Person_1.[LastName] AS
> > [dbo_Person_LastName], Person_1.[FirstName] AS
> > [dbo_Person_FirstName]\nFROM dbo.Person AS Person_1 \nWHERE
> > concat(Person_1.[FirstName], ?, Person_1.
.[FirstName], ?,
Person_1.[LastName]) LIKE ?'] [parameters: (' ', 'ob Smi')]
I don't see any mention in the documentation of how to indicate the SQL
Server version that queries should be compiled for.
Any suggestions?
Thanks,
Rob
--
You received this message because you are subscribed
Can anyone help me with this interesting (to me) relationship definition in
sqla.
I have some already defined data, not by me, that has, for each user, a
foreign table of contact numbers, where the highest contact number is the
one to use.
For example, users:
Harry, 1081, and Bob 1082
and add back later.
>
> My goal is to not need to re-code the details of the foreign key at the
> time I need to reapply it to the table.
>
>
> Thanks much,
> Rob
>
I've been working on this some more and have figured out something that
works. I'm guessing it could be genera
` and grabbing the data, I can directly grab the
ForeignKey object of interest to delete from the table and add back later.
My goal is to not need to re-code the details of the foreign key at the
time I need to reapply it to the table.
Thanks much,
Rob
--
You received this message because you
ef / back_populates aren't one of them because
> these have to do with the class mapping, rather than tables/columns which
> is why the deferred approach is provided.
>
> You can make your own function that generates that @declared_attr in one
> step to save on verbosity.
>
&g
the wrong value. Can you help me fix this?
Thanks,
Rob
--
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+unsubscr...@googlegroups.com.
To post
Thank Lucas. I've tried that as well. In all cases, SQLAlchemy always
emits a table constraint. i.e., an additional CONSTRAINT clause in the
CREATE TABLE command. Maybe I've poorly phrased my question and SQLAlchemy
always emits table constraints? Here's an updated example. In all three
Thanks. Makes sense.
On Friday, May 29, 2015 at 10:12:07 AM UTC-5, Michael Bayer wrote:
On 5/29/15 2:12 AM, r...@rosenfeld.to javascript: wrote:
Thank Lucas. I've tried that as well. In all cases, SQLAlchemy always
emits a table constraint. i.e., an additional CONSTRAINT clause
Sorry it took my a while to test this, but I didn't see any difference in
the SQL emitted. What did I miss?
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import UniqueConstraint
from sqlalchemy import
Is there a way to control whether DDL emitted by SQLAlchemy uses a column
and/or table constraint for uniqueness?
It seems the following
class Part(Base):
__tablename__ = 'part'
third_party_id = Column(Integer, nullable=True, default=None, unique=
True)
emits a table constraint
CREATE
-sqlalchemy-logger-only-to-a-file
Thanks in advance,
Rob
--
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
=True)
engine.connect()
Cross posted
from
http://stackoverflow.com/questions/29114627/how-to-output-sqlalchemy-logger-only-to-a-file
Thanks in advance,
Rob
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop
Thanks for the reply Mike. The explanation is somewhat as expected.
Based on this, to keep things simple and being bone lazy, I switched the
the 'redis' backend, whose locking is outside of the process and works 100%
with multiple threads out of the box.
--
You received this message because
system level mutex but I assumed
that was the purpose of the underlying dogpile locking)
This is the gist with my
code: https://gist.github.com/mianos/72ba45aed2824875c1a6
Pretty much copied from the example.
Thanks in advance.
- Rob
--
You received this message because you are subscribed
I'm using the ORM and one of my tables does not have a primary key defined.
I am also using DeferredReflection, and I can't seem to figure out how to
defer the PrimaryKeyConstraint until Base.prepare() runs. Any pointers?
Base = declarative_base(cls=DeferredReflection)
class
and 0.9.
On Feb 27, 2014, at 7:29 PM, Michael Bayer
mik...@zzzcomputing.comjavascript:
wrote:
On Feb 27, 2014, at 4:38 PM, Rob Crowell rob.c...@moat.com javascript:
wrote:
# in_ clause with 1 STRING, 1 BINARY
filter_cols = tuple_(HashTest.hash_val, HashTest.hash_type
When I pass binary data to a multi-column in_ clause, I seem to be geting
inconsistent results and I need some help! I did some testing with MySQL,
Postgres, and Vertica (connecting via
https://pypi.python.org/pypi/vertica-sqlalchemy/0.1). It appears MySQL
works correctly but both Postgres
I am having a bit of trouble getting DeferredReflection working the way I
want; not sure if I am overlooking something obvious or if I just don't
really understand how it's supposed to work.
I'm trying to define my models before creating my engine (this does not
work):
Base =
Interesting, thanks Michael. I didn't realize autoload was implied when
using DeferredReflection but that makes sense.
Thanks!
On Monday, February 17, 2014 7:17:34 PM UTC-5, Michael Bayer wrote:
On Feb 17, 2014, at 6:23 PM, Rob Crowell robcc...@gmail.com javascript:
wrote:
I am having
to the select clause, or in a
`from_obj` within the clause, simply blows the `with` statement off the top
of the select. (if that makes any sense)
Is there any way to accomplish this?
Many thanks,
Rob
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group
Thank you *so* much...
And apologies for not having included the object set up ... I thought it'd
obscure more than it showed...
But for the record, the `generate_series` and `row_number() over()` are
spot on :D
On Monday, 15 July 2013 18:58:00 UTC+1, Rob wrote:
(using sqlalchemy
(User.id, meetingRoomCount, bathroomCount).first()
But this returns the total number of meeting rooms and bathrooms in the
database, not the ones that are specific to that user.
I feel like I'm missing something simple here, anyone have any ideas?
-Rob
--
You received this message because you
So anyone else who asks this knows, the following works:
A query with just a column:
qq = session.query(Configuration.name)
Normally I would loop, but in this case, taking just the first column:
yy = qq.column_descriptions[0]['expr']
yy.expression.table.name
gives: ''configurations”
If the query does not have a table in it we don't get the tables.
For example, the following simple query gets a list of connection_strings
column from the Connection table:
aa = session.query(Connection.connection_string)
aa.column_descriptions
[{'aliased': False,
'expr':
We are using the sharding module included in our application.
Currently we are selecting shards based on field. This works really well,
as the field that gets hashed to select the shard needs to be migrated to
the other tables that exist only in that shard.
Now we would like to have
or contains_eager or any of that
yet.
On Feb 27, 2013, at 2:07 AM, Rob Crowell robcc...@gmail.com javascript:
wrote:
Example code: https://gist.github.com/rcrowell/5045832
I have Person and Town tables, which are joined in a many-to-many fashion
through a VisitedDestinations table. I
, VisitedDestinations.town).\
options(contains_eager(Person.visited_destinations,
VisitedDestinations.town)).\
filter(Town.name.in_(['Atlanta', 'Memphis']))
On Feb 27, 2013, at 1:48 PM, Rob Crowell rob.c...@moat.com javascript:
wrote:
Sure! Here's the query I am attempting to replicate:
SELECT
, at 2:40 PM, Rob Crowell rob.c...@moat.com javascript:
wrote:
Ah okay, so you do recommend the contains_eager approach. I guess this is
exactly the use-case it is designed for? I always get a little scared when
I try using advanced features of SQLAlchemy :)
One last question. The query here
I'm building a pyramid application using pyramid_tm and
ZopeTransactionExtension. We've written a little subscriber on NewResponse
that writes out some values to a log file about the current user
(request.user.id) after each request. For anybody that knows pyramid
pretty well, we set the
Thanks Michael,
Writing a big list of conditions and combining them with and_(*conditions)
worked well. I was indeed querying like this before:
for condition in conditions:
q = q.filter(condition)
print q
On Friday, January 18, 2013 6:00:04 PM UTC-5, Michael Bayer wrote:
On Jan 18,
I haven't boiled this down to a short test case yet, but when my WHERE
clause gets especially long I start getting the recursion depth exceeded
exception. Is this a well-known limitation of sqlalchemy? We're running
this query in production currently without SQLAlchemy, and it performs
fine,
...@zzzcomputing.com wrote:
On Nov 16, 2012, at 2:59 PM, Rob Crowell wrote:
Thanks for the help so far Michael! I can explain a little more about
what I'm trying to do (I'm using a fictional application here but I
think it pretty accurately translates into my actual application).
BACKGROUND
On Nov 15, 10:48 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Nov 15, 2012, at 7:33 PM, Rob Crowell wrote:
Sorry, that got cut off at the end.
class IssueTag(Base):
__tablename__ = 'issue_user_tag'
sqlalchemy.exc.InvalidRequestError: Table 'issue_user_tag
Hi Michael,
That does exactly what I was after (and I've learned a little bit more
about sqalchemy!)
Thank you very much for your help.
On Thursday, 23 August 2012 19:13:27 UTC+1, Michael Bayer wrote:
On Aug 23, 2012, at 10:04 AM, Rob wrote:
Hi Michael,
I have a similar (but subtly
. (rather than bunging up this message, please see the
attached file)
I'd be really grateful if you could take a look and hopefully point me in
the right direction.
Many thanks,
Rob
On Wednesday, 17 August 2011 00:42:28 UTC+1, Michael Bayer wrote:
On Aug 16, 2011, at 5:37 PM, Mike
necessarily be
very limited in scope: it would not support table creation and only
have a dialectical backing for MySQL. Many other components I could
leave as stubs. In any case, I want to avoid design decisions that
will limit future extensibility.
Thanks!
-- Rob
--
You received this message because
will need to be passed to an __init__ in the class above.
Is there a strategy for dealing with this?
Many thanks,
Rob
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from
])
db.flush()
A flush is required (at some point) to commit the data to the table,
but for multiple inserts the method above is horribly slow.
Am I missing something fundamental? Is there a faster/better
(possibly correct!) way to do this?
Many thanks,
Rob
--
You received this message because you
Thanks for your super-quick response Michael !!
I have a feeling that (especially given that there are a number of
foreign keys involved in this) I may be best off, as you suggest,
using the mappings/reflected tables.
Many thanks again,
Rob
On Feb 9, 11:17 pm, Michael Bayer mike
equated, locally
mapped column pairs for primaryjoin condition 'call.caller_id =
contact.id' on relation Call.caller. For more relaxed rules on join
conditions, the relation may be marked as viewonly=True.
Can someone tell me what I'm doing wrong, please?
Thanks,
Rob
')
})
did the trick.
Thanks!
On Aug 23, 8:58 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Aug 23, 2008, at 1:56 PM, Rob wrote:
Hi,
I'm using sqlalchemy 0.5 beta 3 and I am trying to have a Call object
that contains two relations to a Contact object. One is the callee
and the other
the collection to be aware of existing
indices, and not write a row for existing relationship (i think there
is a pattern for this on the wiki).
Am I biting of more than sa can chew? Should I implement this in some
other, more app-specific way?
Thanks in advance,
Rob C
.
Regardless, I think the rest of your answer implies a custom solution
is appropriate.
Cheers,
Rob C
On Jul 20, 6:44 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jul 20, 2008, at 1:22 PM, Rob Cowie wrote:
I have a many-to-many relationship between 'Company' and 'Index',
defined
54 matches
Mail list logo