Run SQL query with python in SQL Server raises error: SqlSatelliteCall error: Unsupported input data type in column
Sometimes the error messge can be misleading. In this case it's not. You're trying to use unsupported data type:


  Unsupported input data type in column 'ProductID'. Supported types:
  bit, tinyint, smallint, int, bigint, uniqueidentifier, real, float,
  char, varchar, nchar, nvarchar, varbinary.


These two columns are causing the error:

ProductID numeric(18,3)
RegionID numeric(18,3)


According to Microsoft docs, bigint is the SQLtype equivalent to numeric Python type.

Please, try to run your code like this:

exec sp_execute_external_script
@language = N'python', @script = N'

import pandas as pd
inventory = pd.DataFrame(sql_inventory)

',
@input_data_1 = N'SELECT TOP 10 ShopCode, QTY, Date, Amount, ID FROM inventory',
@input_data_1_name = N'sql_inventory'


If I'm right, it should run fine. Since both columns ProductID and RegionID are numeric type you must either CAST or CONVERT those columns to refer to them in the query, but beware of the possibility of precision loss when converting from numeric to float or real.


  Should I specify data types every time I want to read from a query?


No. Just use the supported data types and you should be fine.