def validate()

in generator/dryrun.py [0:0]


    def validate(self):
        """Dry run the provided SQL file and check if valid."""
        dry_run_error = DryRunError(
            "Error when dry running SQL",
            self.get_error(),
            self.use_cloud_function,
            self.table,
        )

        if self.dry_run_result is None:
            raise dry_run_error

        if self.dry_run_result["valid"]:
            return True
        elif self.get_error() == Errors.READ_ONLY:
            # We want the dryrun service to only have read permissions, so
            # we expect CREATE VIEW and CREATE TABLE to throw specific
            # exceptions.
            return True
        elif self.get_error() == Errors.DATE_FILTER_NEEDED:
            # With strip_dml flag, some queries require a partition filter
            # (submission_date, submission_timestamp, etc.) to run
            return True
        else:
            print("ERROR\n", self.dry_run_result["errors"])
            raise dry_run_error