mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore: use contextlib.surpress instead of passing on error (#24896)
Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
72150ebadf
commit
e585db85b6
@@ -14,6 +14,7 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import contextlib
|
||||
import json
|
||||
import re
|
||||
import urllib
|
||||
@@ -557,11 +558,8 @@ class BigQueryEngineSpec(BaseEngineSpec): # pylint: disable=too-many-public-met
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
return encrypted_extra
|
||||
|
||||
try:
|
||||
with contextlib.suppress(KeyError):
|
||||
config["credentials_info"]["private_key"] = PASSWORD_MASK
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
return json.dumps(config)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user