[sqlalchemy] Re: Apache Beam SQLAlchemy PyMySql?

2019-05-18 Thread mkwyche
I think my issue is I just didn't have mysql+pymysql :facepalm: . Will continue to update in case others want to do this. On Saturday, May 18, 2019 at 5:40:58 PM UTC-4, mkwyche wrote: > > Hi, > > I'm trying to run a Beam Pipeline with SQLAlchemy. Google DataFlowRunner >

[sqlalchemy] Apache Beam SQLAlchemy PyMySql?

2019-05-18 Thread mkwyche
n, \ File "/Users/mkwyche/workspace/python/phy/uploader/season_stat_calculator/upload_season_stats_rocky.py", line 12, in from phy.shared.models.season_stats.season_stats import SeasonStats File "/Users/mkwyche/workspace/python/phy/shared/models/__init__.py&qu

[sqlalchemy] Re: Order By Relationship Set Order Type Desc

2019-04-29 Thread mkwyche
Looks like you can add `.desc()` after the column name :-D On Monday, April 29, 2019 at 3:40:24 PM UTC-4, mkwyche wrote: > > Looking through the docs and I see there's an `order_by` attribute on > relationships( > https://docs.sqlalchemy.org/en/13/orm/rela

[sqlalchemy] Order By Relationship Set Order Type Desc

2019-04-29 Thread mkwyche
Looking through the docs and I see there's an `order_by` attribute on relationships( https://docs.sqlalchemy.org/en/13/orm/relationship_api.html#sqlalchemy.orm.relationship). How would I order by desc instead of asc? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://

Re: [sqlalchemy] Re: Foreign Key Constraint In Different Database Support

2019-03-20 Thread mkwyche
Awesome thanks again really appreciate it! On Wednesday, March 20, 2019 at 5:58:44 PM UTC-4, Mike Bayer wrote: > > On Wed, Mar 20, 2019 at 5:52 PM mkwyche > > wrote: > > > > Thanks for the help. Is it best practice to use one declarative_base for > all models and s

Re: [sqlalchemy] Re: Foreign Key Constraint In Different Database Support

2019-03-20 Thread mkwyche
".bind" > argument to MetaData, in that it suggests the MetaData would know > about the default schema name of the engine which is not the case. > The .bind argument will be going away in a future release for reasons > like this. > > On Wed, Mar 20, 2019 at 2:23 PM mkwyche &

Re: [sqlalchemy] Re: Foreign Key Constraint In Different Database Support

2019-03-20 Thread mkwyche
I think I see my biggest issue now. I thought that I needed multiple `declarative_base` for each database but I can use the same one for all models and specify schema. On Wednesday, March 20, 2019 at 1:02:47 PM UTC-4, mkwyche wrote: > > Here's the code I'm using to create `

Re: [sqlalchemy] Re: Foreign Key Constraint In Different Database Support

2019-03-20 Thread mkwyche
have been derived from the base associated with the actual model. On Wednesday, March 20, 2019 at 9:55:44 AM UTC-4, Mike Bayer wrote: > > On Wed, Mar 20, 2019 at 7:43 AM mkwyche > > wrote: > > > > For anyone else that runs into a similar issue. This > https://

[sqlalchemy] Re: Foreign Key Constraint In Different Database Support

2019-03-20 Thread mkwyche
#x27;t the schema derived from the `declaritive_base` associated with the model? On Wednesday, March 20, 2019 at 7:16:06 AM UTC-4, mkwyche wrote: > > Also I tried to put in their mesa.player_pro.phil_Id instead of the actual > column and I get this error: > > ``` > sqlalch

[sqlalchemy] Re: Foreign Key Constraint In Different Database Support

2019-03-20 Thread mkwyche
oreign key to target column 'phil_id' ``` Is there a way to reference a table from another DeclaritiveBase? On Wednesday, March 20, 2019 at 7:11:06 AM UTC-4, mkwyche wrote: > > Hi, > > I have two classes: > > ```python > > class PlayerPro(MESA_BASE): > &

[sqlalchemy] Foreign Key Constraint In Different Database Support

2019-03-20 Thread mkwyche
Hi, I have two classes: ```python class PlayerPro(MESA_BASE): ''' player_pro model ''' __tablename__ = "player_pro" # Primary Keys ebis_id = Column(MEDIUMINT(9), primary_key=True) bam_id = Column(MEDIUMINT(9), index=True) phil_id = Column(MEDIUMINT(9), index=True) cla