Skip to content
Advertisement

Tag: python

python list in tuple compare

I have a list and a tuple ( from sqlite query) and what to check if the items in list are not in the db tuple. If not add to newJobs list links = [“example.com”, “mysite.com”] …

Saleforce retrieving fields from two different objects – (SOQL) Simple Salesforce Python

I am using simpleSalesforce library for python to query SalesForce. I am looking at two different object in SalesForce: Account and Backend (parent-child). The Id in account matches the records of Backend through acc_id I am trying to do this: But I get the response showing: Malformed request – didn’t understand the relationship – in FROM part of query call.

datetime.datetime conversion to datetime

I have defined a column in SQL Server as ldate with datetime data type and accepting null values. I’m trying to send data from my local machine using python and pyodbc. I have date like 20-01-2015 in string format. When I try to send data it throws an error: pyodbc.DataError: (‘22007’, ‘[22007] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Conversion failed

How to add a ranking to a pyspark dataframe

I have a pyspark dataframe with 2 columns – id and count. I want to add a ranking to this by reverse count. So the highest count has rank 1, second highest rank 2, etc. testDF = spark.createDataFrame([(DJS232,437232)], [“id”, “count”]) I first tried using and this worked, ish. It had monotonically increasing id numbers but the jump from the first

How Can My sqllite3 interaction be fixed?

I’m trying to get an admin account to edit a ‘rank’ (basically access level) for one of the profiles in my data-base. The error is: The code that seems to be the problem is: Originally, it was all on one line and it didn’t work, and now I’ve tried it on multiple lines and it still doesn’t work. So I

How to connect to a Azure SQL Server through Python

I’ve come across some trouble accessing my SQL Server through Python. I can get it going when my SQL Server is installed locally, but not when it is online. I have used the following code: Connection to SQL Server but then when I try and run: I get the error: InterfaceError: (‘IM002’, ‘[IM002] [Microsoft][ODBC Driver Manager] Data source name not

Advertisement