openclimatefix / nowcasting_datamodel

Datamodel for the nowcasting project
6 stars 6 forks source link

Remove SAWarning #148

Closed jacobbieker closed 5 months ago

jacobbieker commented 1 year ago

Describe the bug

Everytime this is imported, it outputs

  class ForecastValueYearMonth(ForecastValueSQLMixin, Base_Forecast):
/home/jacob/miniconda3/envs/metnet3/lib/python3.10/site-packages/nowcasting_datamodel/models/forecast.py:195: SAWarning: This declarative base already contains a class with the same class name and module name as nowcasting_datamodel.models.forecast.ForecastValueYearMonth, and will be replaced in the string-lookup table.
  class ForecastValueYearMonth(ForecastValueSQLMixin, Base_Forecast):

Which really pollutes the training logs and is somewhat annoying to see all the time. Filtering warnings doesn't seem to get rid of it either.

To Reproduce Import datamodel

Expected behavior No warning emitted.

Additional context Add any other context about the problem here.

rahul-maurya11b commented 6 months ago

Hi @jacobbieker sir, I am trying to attempt this issue and while testing I saw other warnings too like : 1.deprecated Pydantic V1 style @validator 2.Deprecated Config Keys 3.FutureWarnings 4.SAWarnings

trying to solve these warnings I started with SAWarings and made some changes to try but that was not correct tests are not passing and still getting SAWarning .

Can you suggest something related to SAWarning problem solution.