maahir22 commented on PR #30432: URL: https://github.com/apache/airflow/pull/30432#issuecomment-1503720828
> Needs non-hardcoded attributes, they should be retrieved from dag_details. There are a number of ways you can do it: https://stackoverflow.com/questions/2675028/list-attributes-of-an-object Possibly you should filter some (those starting with `_` and other common object attributes. They should also likely be sorted. @potiuk On closer inspection, I found that listing attributes of the class directly isn't going to be a scalable solution either - we have to omit function names / other variable names in such a case as well - highly probable that someone adds a new function to the schema and doesn't add it to the test. So, I've simply mimicked the process -> we get the DAG by querying and then dump to obtain the schema fields, finally we just check whether all fields present in this dumped schema are present in the response obtained from the CLI Command. This should be a scalable solution since we don't have to worry about hardcoding variables/function names anywhere anymore. PS: In our case as per the StackOverflow link only dir worked - vars & __dict__ threw unreliable empty results. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
